about summary refs log tree commit diff
path: root/src/Xanthous/Entities/Entities.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2020-01-20T16·37-0500
committerGriffin Smith <root@gws.fyi>2020-01-20T16·37-0500
commit7082a4088ba06c825eb45f89888fed2f4577ed10 (patch)
tree0d4669b2d5e3815876ff1019a3f3c06e1e37304f /src/Xanthous/Entities/Entities.hs
parent72edcff32307ffebda07d350634792cc86b268bb (diff)
Store revealed positions on the level itself
This was a bit of an oversight initially - we should be storing the
positions that the character has seen *on the level*, rather than on the
entire game state, for obvious reasons. This introduces a GameLevel
record, which has this field, the entities, and also the up staircase
position, which we can *also* use to position the character after going
down to a level we've already visited.
Diffstat (limited to 'src/Xanthous/Entities/Entities.hs')
-rw-r--r--src/Xanthous/Entities/Entities.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Xanthous/Entities/Entities.hs b/src/Xanthous/Entities/Entities.hs
index 1e533a297310..1b9f138fe22f 100644
--- a/src/Xanthous/Entities/Entities.hs
+++ b/src/Xanthous/Entities/Entities.hs
@@ -40,6 +40,8 @@ instance FromJSON SomeEntity where
       "GroundMessage" -> SomeEntity @GroundMessage <$> obj .: "data"
       _ -> fail . unpack $ "Invalid entity type \"" <> entityType <> "\""
 
+deriving via WithOptions '[ FieldLabelModifier '[Drop 1] ] GameLevel
+  instance FromJSON GameLevel
 deriving via WithOptions '[ FieldLabelModifier '[Drop 1] ] GameState
   instance FromJSON GameState