DEADSOFTWARE

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