Attempt to improve perfomance
This commit is contained in:
+3
-3
@@ -65,11 +65,11 @@ destroyBlock bl w =
|
||||
ps = replicateM 25 (randInCirc 20) & evalState $ _randGen w
|
||||
|
||||
-- this does not handle eg doors blocking the path as well
|
||||
maybeClearPaths :: Set (Int, Int, PathEdge) -> World -> World
|
||||
maybeClearPaths :: Set PathEdgeNodes -> World -> World
|
||||
maybeClearPaths ps w = foldl' maybeClearPath w ps
|
||||
|
||||
maybeClearPath :: World -> (Int, Int, PathEdge) -> World
|
||||
maybeClearPath w (x, y, pe)
|
||||
maybeClearPath :: World -> PathEdgeNodes -> World
|
||||
maybeClearPath w (PathEdgeNodes x y pe)
|
||||
| not . null $ overlapSegWalls (_peStart pe) (_peEnd pe) $ wlsNearSeg (_peStart pe) (_peEnd pe) w =
|
||||
w
|
||||
| otherwise = w & cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles .~ mempty) . FGL.delEdge (x, y)
|
||||
|
||||
Reference in New Issue
Block a user