Creature zoning refactor

This commit is contained in:
2022-06-28 11:50:53 +01:00
parent 61ad58c04a
commit 0cb6657f35
4 changed files with 25 additions and 27 deletions
+2 -2
View File
@@ -252,8 +252,8 @@ circOnSomeWall p rad = runIdentity . S.any_ (uncurry (circOnSeg p rad) . _wlLine
-- . wallsNearPoint p
{- | Adds the distance to the creature radius, tests whether the center is in
the circle of this size centered at the point -}
crsNearPoint :: Float -> Point2 -> World -> Bool
crsNearPoint d p = any (\c -> dist (_crPos c) p < (d + _crRad c)) . _creatures
anyCrNearPoint :: Float -> Point2 -> World -> Bool
anyCrNearPoint d p = any (\c -> dist (_crPos c) p < (d + _crRad c)) . _creatures
{- | Produce an unordered list of creatures on a line. -}
crsOnLine :: Point2 -> Point2 -> World -> IM.IntMap Creature
crsOnLine p1 p2