Move toward shell storing update as list

This commit is contained in:
2022-07-20 11:49:10 +01:00
parent 6eb09a991e
commit 577cf0c44e
8 changed files with 162 additions and 34 deletions
+9
View File
@@ -35,6 +35,8 @@ module Dodge.Base.Collide
, canSee
, canSeeIndirect
, isWalkable
, anythingHitCirc
) where
import Dodge.Data
import Dodge.Zone
@@ -212,3 +214,10 @@ canSeeIndirect i j w = hasLOSIndirect ipos jpos w
where
ipos = _crPos (_creatures w IM.! i)
jpos = _crPos (_creatures w IM.! j)
anythingHitCirc :: Float -> Point2 -> Point2 -> World -> Bool
anythingHitCirc rad sp ep w = hitCr || isJust (sequence hitWl)
where
hitCr = runIdentity $ S.any_ (const True) $ overlap1SegCrs sp ep $ crsNearSeg sp ep w
hitWl = collideCircWallsStream sp ep rad $ wlsNearPoint ep w
-- this should probably be wallsOnLine or something