Add in "linear" lWorld to separate time reversable worlds
This commit is contained in:
@@ -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 ::
|
||||
|
||||
Reference in New Issue
Block a user