DEADSOFTWARE

Update version script
[cavedroid.git] / core / src / main / kotlin / ru / deadsoftware / cavedroid / game / input / IGameInputHandler.kt
1 package ru.deadsoftware.cavedroid.game.input
3 import ru.deadsoftware.cavedroid.game.input.action.IGameInputAction
4 import ru.deadsoftware.cavedroid.game.input.action.KeyboardInputAction
5 import ru.deadsoftware.cavedroid.game.input.action.MouseInputAction
7 interface IKeyboardInputHandler : IGameInputHandler<KeyboardInputAction>
9 interface IMouseInputHandler : IGameInputHandler<MouseInputAction>
11 interface IGameInputHandler<A : IGameInputAction> {
13 /**
14 * Implementation should check if conditions for handling an input are satisfied
15 * For example - inventory input handler should return false if inventory is closed
16 */
17 fun checkConditions(action: A): Boolean
19 /**
20 * Handle given input action.
21 * This will not be called if [checkConditions] returned false
22 */
23 fun handle(action: A)
25 }