26 lines
No EOL
1.2 KiB
Haskell
26 lines
No EOL
1.2 KiB
Haskell
-- Implementations for each state can be found in their respective
|
|
-- submodules.
|
|
module RPGEngine.Input
|
|
( handleAllInput
|
|
) where
|
|
|
|
import RPGEngine.Input.Core ( InputHandler, composeInputHandlers, handleAnyKey )
|
|
|
|
import RPGEngine.Data ( Game(..), State(..) )
|
|
import RPGEngine.Input.Menu ( handleInputMenu )
|
|
import RPGEngine.Input.LevelSelection (handleInputLevelSelection)
|
|
import RPGEngine.Input.Playing ( handleInputPlaying )
|
|
import RPGEngine.Input.Paused ( handleInputPaused )
|
|
import RPGEngine.Input.Win ( handleInputWin )
|
|
import RPGEngine.Input.Lose ( handleInputLose )
|
|
|
|
------------------------------ Exported ------------------------------
|
|
|
|
-- Handle all input of all states of the game.
|
|
handleAllInput :: InputHandler Game
|
|
handleAllInput ev g@Game{ state = Menu } = handleInputMenu ev g
|
|
handleAllInput ev g@Game{ state = LevelSelection{} } = handleInputLevelSelection ev g
|
|
handleAllInput ev g@Game{ state = Playing{} } = handleInputPlaying ev g
|
|
handleAllInput ev g@Game{ state = Paused{} } = handleInputPaused ev g
|
|
handleAllInput ev g@Game{ state = Win } = handleInputWin ev g
|
|
handleAllInput ev g@Game{ state = Lose{} } = handleInputLose ev g |