Start simplifying/removing Wall records

This commit is contained in:
2025-10-23 18:11:01 +01:00
parent fc7c4d6468
commit 819f0d37ea
18 changed files with 230 additions and 243 deletions
-14
View File
@@ -30,7 +30,6 @@ module Dodge.Base.Collide (
hasButtonLOS,
canSee,
canSeeIndirect,
isWalkable,
anythingHitCirc,
collide3WallsFloor,
collide3,
@@ -41,7 +40,6 @@ import Control.Monad
import qualified Data.IntSet as IS
import Data.List (sortOn)
import Data.Maybe
import Data.Monoid
import Dodge.Base.Wall
import Dodge.Creature.Radius
import Dodge.Data.Object
@@ -325,18 +323,6 @@ hasLOSIndirect p1 p2 =
. collidePointTestFilter wlIsOpaque p1 p2
. wlsNearSeg p1 p2
isFlyable :: Point2 -> Point2 -> World -> Bool
{-# INLINE isFlyable #-}
isFlyable p1 p2 =
not
. collidePointTestFilter (not . (^?! wlPathable)) p1 p2
. wlsNearSeg p1 p2
isWalkable :: Point2 -> Point2 -> World -> Bool
{-# INLINE isWalkable #-}
isWalkable p1 p2 w = isFlyable p1 p2 w && not (getAny $ foldMap f (w ^. cWorld . chasms))
where
f = foldMap (Any . isJust . uncurry (intersectSegSeg p1 p2)) . loopPairs
canSee :: Int -> Int -> World -> Bool
{-# INLINE canSee #-}