DEADSOFTWARE

065b28cd63e1e21f122f0f5fcef8db761eb02936
[cavedroid.git] /
1 package ru.deadsoftware.cavedroid.game.input.handler.keyboard
3 import ru.deadsoftware.cavedroid.MainConfig
4 import ru.deadsoftware.cavedroid.game.GameScope
5 import ru.deadsoftware.cavedroid.game.input.IKeyboardInputHandler
6 import ru.deadsoftware.cavedroid.game.input.KeyboardInputHandler
7 import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction
8 import ru.deadsoftware.cavedroid.game.input.action.keys.KeyboardInputActionKey
9 import javax.inject.Inject
11 @GameScope
12 @KeyboardInputHandler
13 class ToggleDebugInfoKeyboardInputHandler @Inject constructor(
14 private val mainConfig: MainConfig
15 ) : IKeyboardInputHandler {
17 override fun checkConditions(action: KeyboardInputAction): Boolean {
18 return action.actionKey is KeyboardInputActionKey.ShowDebug && action.isKeyDown
19 }
21 override fun handle(action: KeyboardInputAction) {
22 mainConfig.isShowInfo = !mainConfig.isShowInfo
23 }
24 }