Cleanup
This commit is contained in:
+15
-10
@@ -1,15 +1,19 @@
|
||||
module Dodge.Block where
|
||||
module Dodge.Block (
|
||||
splinterBlock,
|
||||
destroyBlock,
|
||||
destroyDoor,
|
||||
) where
|
||||
|
||||
import Control.Monad
|
||||
import Data.Set (Set)
|
||||
import Dodge.Data.MountedObject
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.Foldable
|
||||
import qualified Data.Graph.Inductive as FGL
|
||||
import qualified Data.IntSet as IS
|
||||
import Data.Maybe
|
||||
import Data.Set (Set)
|
||||
import Dodge.Base.Collide
|
||||
import Dodge.Block.Debris
|
||||
import Dodge.Data.MountedObject
|
||||
import Dodge.Data.World
|
||||
import Dodge.DrWdWd
|
||||
import Dodge.LightSource
|
||||
@@ -44,10 +48,10 @@ unshadowBlock w wlid = case w ^? cWorld . lWorld . walls . ix wlid of
|
||||
& insertWallInZones (wl & wlUnshadowed .~ True)
|
||||
Nothing -> w
|
||||
|
||||
checkBlockHP :: Block -> World -> World
|
||||
checkBlockHP bl
|
||||
| _blHP bl < 1 = destroyBlock bl
|
||||
| otherwise = id
|
||||
--checkBlockHP :: Block -> World -> World
|
||||
--checkBlockHP bl
|
||||
-- | _blHP bl < 1 = destroyBlock bl
|
||||
-- | otherwise = id
|
||||
|
||||
destroyBlock :: Block -> World -> World
|
||||
destroyBlock bl w =
|
||||
@@ -74,8 +78,9 @@ maybeClearPath :: World -> PathEdgeNodes -> World
|
||||
maybeClearPath w (PathEdgeNodes x y pe)
|
||||
| not . null $ overlapSegWalls (_peStart pe) (_peEnd pe) $ wlsNearSeg (_peStart pe) (_peEnd pe) w =
|
||||
w
|
||||
| otherwise = w
|
||||
& cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles .~ mempty) . FGL.delEdge (x, y)
|
||||
| otherwise =
|
||||
w
|
||||
& cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles .~ mempty) . FGL.delEdge (x, y)
|
||||
|
||||
destroyDoor :: Door -> World -> World
|
||||
destroyDoor dr w =
|
||||
|
||||
Reference in New Issue
Block a user