Refactor crPos to be a V3

This commit is contained in:
2025-10-10 13:47:31 +01:00
parent 98ece551c7
commit 49fb982877
58 changed files with 375 additions and 307 deletions
+2 -1
View File
@@ -10,6 +10,7 @@ import Dodge.Zoning.Common
import FoldableHelp
import Geometry
import qualified IntMapHelp as IM
import Linear
crIXsNearPoint :: Point2 -> World -> IS.IntSet
crIXsNearPoint = nearPoint crZoneSize _crZoning
@@ -42,7 +43,7 @@ crZoneSize :: Float
crZoneSize = 15
zoneOfCr :: Creature -> [Int2]
zoneOfCr cr = zoneOfCirc crZoneSize (_crPos cr) (crRad $ cr ^. crType)
zoneOfCr cr = zoneOfCirc crZoneSize (cr ^. crPos . _xy) (crRad $ cr ^. crType)
minCrIXOn :: Ord a => (Creature -> a) -> IS.IntSet -> World -> Maybe Creature
minCrIXOn f is w = fst <$> IS.foldl' g Nothing is