Add in "linear" lWorld to separate time reversable worlds

This commit is contained in:
2022-10-28 12:24:51 +01:00
parent 5f6bd43599
commit 7e790b7153
130 changed files with 827 additions and 980 deletions
+6 -6
View File
@@ -9,11 +9,11 @@ import Dodge.Data.World
getItem :: Int -> World -> Maybe Item
getItem itid w = do
itpos <- w ^? cWorld . itemLocations . ix itid
itpos <- w ^? cWorld . lWorld . itemLocations . ix itid
case itpos of
OnFloor flitid -> w ^? cWorld . floorItems . ix flitid . flIt
InInv cid invid -> w ^? cWorld . creatures . ix cid . crInv . ix invid
OnTurret mcid -> w ^? cWorld . machines . ix mcid . mcType . _McTurret . tuWeapon
OnFloor flitid -> w ^? cWorld . lWorld . floorItems . ix flitid . flIt
InInv cid invid -> w ^? cWorld . lWorld . creatures . ix cid . crInv . ix invid
OnTurret mcid -> w ^? cWorld . lWorld . machines . ix mcid . mcType . _McTurret . tuWeapon
InVoid -> Nothing
pointerToItemLocation ::
@@ -22,8 +22,8 @@ pointerToItemLocation ::
(Item -> f Item) ->
World ->
f World
pointerToItemLocation (InInv cid invid) = cWorld . creatures . ix cid . crInv . ix invid
pointerToItemLocation (OnFloor flid) = cWorld . floorItems . ix flid . flIt
pointerToItemLocation (InInv cid invid) = cWorld . lWorld . creatures . ix cid . crInv . ix invid
pointerToItemLocation (OnFloor flid) = cWorld . lWorld . floorItems . ix flid . flIt
pointerToItemLocation _ = const pure
pointerToItem ::