-
Notifications
You must be signed in to change notification settings - Fork 0
/
StageData.hs
31 lines (25 loc) · 912 Bytes
/
StageData.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module StageData where
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
type Id = String
type Name = String
type Stats = Map.Map Id Integer
type Things = Set.Set Id
data Game = Game { world :: World
, actions :: Map.Map Name [Action]
, describeWorld :: World -> String
}
data World = World { things :: Map.Map Id Thing
, player :: Thing
, location :: Id
}
data Action = Action { shouldRun :: World -> Bool
, updateWorld :: World -> Maybe World
, describeAction :: World -> String
}
data Thing = Thing { name :: Name
, describeThing :: World -> Thing -> String
, stats :: Stats
, contents :: Things
, thingId :: Id
}