Fix dependency loop
This commit is contained in:
parent
b7278d6afc
commit
f529fc5237
25 changed files with 251 additions and 199 deletions
|
@ -16,32 +16,23 @@ data Game = Game {
|
|||
|
||||
------------------------------- State --------------------------------
|
||||
|
||||
-- Code reusability
|
||||
data StateBase = StateBase {
|
||||
renderer :: Renderer State,
|
||||
inputHandler :: InputHandler Game
|
||||
}
|
||||
|
||||
-- Main menu
|
||||
data State = Menu { base :: StateBase }
|
||||
data State = Menu
|
||||
-- Select the level you want to play
|
||||
| LevelSelection { base :: StateBase,
|
||||
levelList :: [FilePath],
|
||||
| LevelSelection { levelList :: [FilePath],
|
||||
selector :: ListSelector }
|
||||
-- Playing a level
|
||||
| Playing { base :: StateBase,
|
||||
levels :: [Level],
|
||||
| Playing { levels :: [Level],
|
||||
count :: Int,
|
||||
level :: Level,
|
||||
player :: Player,
|
||||
restart :: State }
|
||||
-- Paused while playing a level
|
||||
| Paused { base :: StateBase,
|
||||
continue :: State }
|
||||
| Paused { continue :: State }
|
||||
-- Won a level
|
||||
| Win { base :: StateBase }
|
||||
| Win
|
||||
-- Lost a level
|
||||
| Lose { base :: StateBase,
|
||||
restart :: State }
|
||||
| Lose { restart :: State }
|
||||
|
||||
------------------------------- Level --------------------------------
|
||||
|
||||
|
|
Reference in a new issue