Cleanup
This commit is contained in:
+2
-6
@@ -104,17 +104,13 @@ allWalls :: World -> IM.IntMap Wall
|
||||
allWalls = IM.unions . concatMap IM.elems . IM.elems . _znObjects . _wallsZone
|
||||
|
||||
creatureNearPoint :: Point2 -> World -> Maybe Creature
|
||||
creatureNearPoint p = L.fold (L.minimumOn (dist p . _crPos)) . creaturesNearPoint p
|
||||
creatureNearPoint = creatureNearPointI 1
|
||||
|
||||
creatureNearPointI :: Int -> Point2 -> World -> Maybe Creature
|
||||
creatureNearPointI n p = L.fold (L.minimumOn (dist p . _crPos)) . creaturesNearPointI n p
|
||||
|
||||
creaturesNearPoint :: Point2 -> World -> IM.IntMap Creature
|
||||
creaturesNearPoint p w = IM.unions
|
||||
[f b $ f a $ _znObjects $ _creaturesZone w | a<-[x-1,x,x+1] , b<-[y-1,y,y+1]]
|
||||
where
|
||||
(x,y) = crZoneOfPoint p
|
||||
f i m = fromMaybe IM.empty $ IM.lookup i m
|
||||
creaturesNearPoint = creaturesNearPointI 1
|
||||
|
||||
creaturesNearPointI :: Int -> Point2 -> World -> IM.IntMap Creature
|
||||
creaturesNearPointI n p w = IM.unions
|
||||
|
||||
Reference in New Issue
Block a user