Skip to content

Instantly share code, notes, and snippets.

@tomaszrykala
Created January 20, 2018 23:39
Show Gist options
  • Save tomaszrykala/a58d2051cb9c74ba1a8f8abc66eb0295 to your computer and use it in GitHub Desktop.
Save tomaszrykala/a58d2051cb9c74ba1a8f8abc66eb0295 to your computer and use it in GitHub Desktop.
DoReFindMiActivity.kt
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