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
+3 -3
View File
@@ -11,7 +11,7 @@ import LensHelp
destroyMachine :: Machine -> World -> World
destroyMachine mc =
(cWorld . machines %~ IM.delete (_mcID mc))
(cWorld . lWorld . machines %~ IM.delete (_mcID mc))
. deleteWallIDs (_mcWallIDs mc)
. makeExplosionAt (_mcPos mc)
. mcKillTerm mc
@@ -26,7 +26,7 @@ destroyMcType mt mc = case mt of
mcKillTerm :: Machine -> World -> World
mcKillTerm mc w = fromMaybe w $ do
tmid <- mc ^? mcMounts . ix ObTerminal
tm <- w ^? cWorld . terminals . ix tmid
tm <- w ^? cWorld . lWorld . terminals . ix tmid
return $
w
& doTmWdWd (_tmDeathEffect tm) tm
@@ -34,4 +34,4 @@ mcKillTerm mc w = fromMaybe w $ do
mcKillBut :: Machine -> World -> World
mcKillBut mc w = fromMaybe w $ do
btid <- mc ^? mcMounts . ix ObButton
return $ w & cWorld . buttons . at btid .~ Nothing
return $ w & cWorld . lWorld . buttons . at btid .~ Nothing