Created
January 20, 2018 23:39
-
-
Save tomaszrykala/a58d2051cb9c74ba1a8f8abc66eb0295 to your computer and use it in GitHub Desktop.
DoReFindMiActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DoReFindMiActivity : Activity() { | |
private val abcButtonsController = AbcButtonsController(AbcButtonsSupplierImpl()) | |
private val abcLedsController = AbcLedsController(AbcLedsSupplierImpl()) | |
private val digiDisplayController = DigiDisplayController(DigiDisplaySupplierImpl()) | |
private val ledStripController = LedStripController(LedStripSupplierImpl()) | |
private val buzzerController = BuzzerController(BuzzerSupplierImpl()) | |
private val gameController: GameController by lazy { | |
GameController( | |
abcButtonsController, | |
abcLedsController, | |
digiDisplayController, | |
Timer(digiDisplayController), | |
Game(ledStripController, buzzerController, GeneratorImpl())) | |
} | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
gameController.startRound() | |
} | |
override fun onDestroy() { | |
gameController.onDestroy() | |
super.onDestroy() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment