Move past/future worlds outside of serialised data structure

This commit is contained in:
2023-03-25 18:50:42 +00:00
parent 7d96616b91
commit da8a2bad6e
6 changed files with 61 additions and 59 deletions
+1 -23
View File
@@ -27,33 +27,12 @@ data CWorld = CWorld
, _cwCamPos :: CamPos
, _cwGen :: CWGen
, _cClock :: Int
, _pastWorlds :: [LWorld]
, _timeFlow :: TimeFlowStatus
, _seenWalls :: IS.IntSet
, _cwTiles :: [Tile]
, _pathGraph :: Gr Point2 PathEdge
, _numberFloorVerxs :: Int
}
data TimeFlowStatus
= DeathTime
{ _deathDelay :: Int }
| NormalTimeFlow
| ScrollTimeFlow
{ _scrollSmoothing :: Int
, _reverseAmount :: Int
, _futureWorlds :: [LWorld]
, _scrollItemLocation :: Int
}
| RewindLeftClick
{ _reverseAmount :: Int
, _scrollItemLocation :: Int
}
| PausedTimeFlow
{ _timeFlowCharge :: Int
, _scrollItemLocation :: Int
}
data CWGen = CWGen
{ _cwgParams :: GenParams
, _cwgWorldBounds :: Bounds
@@ -67,11 +46,10 @@ data CWGen = CWGen
makeLenses ''CWorld
makeLenses ''CWGen
makeLenses ''TimeFlowStatus
concat
<$> mapM
(deriveJSON defaultOptions)
[ ''CWGen
, ''CWorld
, ''TimeFlowStatus
-- , ''TimeFlowStatus
]
+23
View File
@@ -34,6 +34,8 @@ data WorldEventFlag = InventoryChange
data World = World
{ _cWorld :: CWorld
, _pastWorlds :: [LWorld]
, _timeFlow :: TimeFlowStatus
, _randGen :: StdGen
, _toPlaySounds :: M.Map SoundOrigin Sound
, _playingSounds :: M.Map SoundOrigin Sound
@@ -50,6 +52,27 @@ data World = World
, _gsZoning :: IntMap (IntMap IntSet)
}
data TimeFlowStatus
= DeathTime
{ _deathDelay :: Int }
| NormalTimeFlow
| ScrollTimeFlow
{ _scrollSmoothing :: Int
, _reverseAmount :: Int
, _futureWorlds :: [LWorld]
, _scrollItemLocation :: Int
}
| RewindLeftClick
{ _reverseAmount :: Int
, _scrollItemLocation :: Int
}
| PausedTimeFlow
{ _timeFlowCharge :: Int
, _scrollItemLocation :: Int
}
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''TimeFlowStatus
makeLenses ''World