use State Monad for GameState

This commit is contained in:
weiss
2020-04-10 21:18:06 +02:00
parent 149e4173d0
commit 11bafb6f60
2 changed files with 111 additions and 79 deletions

View File

@@ -23,12 +23,12 @@ type SiteInfo =
type ProtoSite =
{ id :: Int
, gold :: Int -- The total number of gold remaining to be mined from this site (-1 if unknown)
, maxMineSize :: Int -- The maximum rate that a mine can extract gold from this site (-1 if unknown)
, structureType :: Int -- -1 No structure, 0 Goldmine, 1 Tower, 2 Barracks
, owner :: Int -- -1 No structure, 0 friendly, 1 enemy
, param1 :: Int -- -1 No structure, else turns till training
, param2 :: Int -- -1 No structure, barracks: 0 knight 1 archer
, gold :: Int
, maxMineSize :: Int
, structureType :: Int
, owner :: Int
, param1 :: Int
, param2 :: Int
}
type Site =
@@ -36,12 +36,13 @@ type Site =
, x :: Int
, y :: Int
, radius :: Int
, gold :: Int
, maxMineSize :: Int
, structureType :: Int
, owner :: Int
, param1 :: Int
, param2 :: Int
, gold :: Int -- The total number of gold remaining to be mined from this site (-1 if unknown)
, maxMineSize :: Int -- The maximum rate that a mine can extract gold from this site (-1 if unknown)
, structureType :: Int -- -1 No structure, 0 Goldmine, 1 Tower, 2 Barracks
, owner :: Int -- -1 No structure, 0 friendly, 1 enemy
, param1 :: Int -- -1 No structure, else turns till training
, param2 :: Int -- -1 No structure, barracks: 0 knight 1 archer
, mineLvl :: Int -- -1 whatever, otherwise curr. mine lvl
}
type Minion =