Refactor doors
This commit is contained in:
+3
-2
@@ -1,4 +1,5 @@
|
||||
module Dodge.Block where
|
||||
import Dodge.DrWdWd
|
||||
import Dodge.Zoning.Wall
|
||||
import Dodge.Data
|
||||
import Dodge.Base.Collide
|
||||
@@ -70,7 +71,7 @@ maybeClearPath w (x,y,pe)
|
||||
|
||||
destroyDoor :: Door -> World -> World
|
||||
destroyDoor dr w = w
|
||||
& _drDeath dr dr
|
||||
& doDrWdWd (_drDeath dr) dr
|
||||
& deleteWallIDs wlids
|
||||
& doors %~ IM.delete (_drID dr)
|
||||
& flip (foldr (wlDustAt awl)) (map (pos +.+) ps)
|
||||
@@ -94,5 +95,5 @@ stopPushing :: Maybe Int -> World -> World
|
||||
stopPushing mdrid w = fromMaybe w $ do
|
||||
drid <- mdrid
|
||||
dr <- w ^? doors . ix drid
|
||||
return $ w & doors . ix drid . drMech .~ const id
|
||||
return $ w & doors . ix drid . drMech .~ DrWdId
|
||||
& stopPushing (_drPushes dr)
|
||||
|
||||
Reference in New Issue
Block a user