Continue to refactor zoning to be more stream-based
This commit is contained in:
+2
-2
@@ -27,7 +27,7 @@ makePathBetween a b w = do -- join $ sp <$> a' <*> b' <*> return (_pathGraph w)
|
||||
nb <- walkableNodeNear b
|
||||
sp na nb (_pathGraph w)
|
||||
where
|
||||
nodesNear p = concat $ lookLookups (zoneAroundPoint p) (_pathPoints w)
|
||||
nodesNear p = concat $ lookLookups (zoneNearPointIP p) (_pathPoints w)
|
||||
walkableNodeNear p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear p
|
||||
|
||||
makePathBetweenPs :: Point2 -> Point2 -> World -> Maybe [Point2]
|
||||
@@ -92,5 +92,5 @@ removePathsCrossing a b w = w
|
||||
& pathPoints .~ foldr insertPoint IM.empty (labNodes newGraph)
|
||||
where
|
||||
pg' = S.filter (isNothing . uncurry (intersectSegSeg a b)) $ _pathGraphP w
|
||||
insertPoint pp@(_,V2 x y) = insertInZoneWith (floorHun x) (floorHun y) (++) [pp]
|
||||
insertPoint pp@(_,p) = uncurryV insertInZoneWith (wallZoneOfPoint p) (++) [pp]
|
||||
newGraph = pairsToGraph dist pg'
|
||||
|
||||
Reference in New Issue
Block a user