about summary refs log tree commit diff
path: root/src/Xanthous/Game/Lenses.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/Game/Lenses.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/Game/Lenses.hs')
-rw-r--r--src/Xanthous/Game/Lenses.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Xanthous/Game/Lenses.hs b/src/Xanthous/Game/Lenses.hs
index 010fcb7022..8f6053a5ec 100644
--- a/src/Xanthous/Game/Lenses.hs
+++ b/src/Xanthous/Game/Lenses.hs
@@ -39,14 +39,16 @@ initialStateFromSeed :: Int -> GameState
 initialStateFromSeed seed =
   let _randomGen = mkStdGen seed
       chr = mkCharacter
-      (_characterEntityID, level)
+      _upStaircasePosition = Position 0 0
+      (_characterEntityID, _levelEntities)
         = EntityMap.insertAtReturningID
-          (Position 0 0)
+          _upStaircasePosition
           (SomeEntity chr)
           mempty
+      _levelRevealedPositions = mempty
+      level = GameLevel {..}
       _levels = oneLevel level
       _messageHistory = mempty
-      _revealedPositions = mempty
       _promptState = NoPrompt
       _activePanel = Nothing
       _debugState = DebugState