Separate out concrete part of world
This commit is contained in:
@@ -9,7 +9,7 @@ import Data.Maybe
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
destroyMachine :: Machine -> World -> World
|
||||
destroyMachine mc = (machines %~ IM.delete (_mcID mc))
|
||||
destroyMachine mc = (cWorld . machines %~ IM.delete (_mcID mc))
|
||||
. deleteWallIDs (_mcWallIDs mc)
|
||||
. makeExplosionAt (_mcPos mc)
|
||||
. mcKillTerm mc
|
||||
@@ -18,11 +18,11 @@ destroyMachine mc = (machines %~ IM.delete (_mcID mc))
|
||||
mcKillTerm :: Machine -> World -> World
|
||||
mcKillTerm mc w = fromMaybe w $ do
|
||||
tmid <- mc ^? mcMounts . ix ObTerminal
|
||||
tm <- w ^? terminals . ix tmid
|
||||
tm <- w ^? cWorld . terminals . ix tmid
|
||||
return $ w
|
||||
& doTmWdWd (_tmDeathEffect tm) tm
|
||||
|
||||
mcKillBut :: Machine -> World -> World
|
||||
mcKillBut mc w = fromMaybe w $ do
|
||||
btid <- mc ^? mcMounts . ix ObButton
|
||||
return $ w & buttons . at btid .~ Nothing
|
||||
return $ w & cWorld . buttons . at btid .~ Nothing
|
||||
|
||||
Reference in New Issue
Block a user