Skip to content

Instantly share code, notes, and snippets.

@lordcirth
Created November 25, 2016 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lordcirth/3c2d9a0ad60dc0ee786db2654183b0c3 to your computer and use it in GitHub Desktop.
Save lordcirth/3c2d9a0ad60dc0ee786db2654183b0c3 to your computer and use it in GitHub Desktop.
-- run a full game turn, ie pre-turn, player turn, enemy turn, post-turn.
-- Currently, only the player exists.
fullGameTurn :: (Action) -> GameState -> GameState
fullGameTurn action gs
-- Player hasn't spent turn - free action or invalid
| not (result^.costsTurn) = result^.gameState
-- Player has spent turn - normal action completed
-- TODO: this is where to run enemy turns, etc
| result^.costsTurn = result^.gameState
where result = playerTurn action gs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment