Add pathing infrastructure
This commit is contained in:
+5
-3
@@ -22,7 +22,7 @@ import qualified IntMapHelp as IM
|
||||
import Tile
|
||||
import RandomHelp
|
||||
|
||||
import Data.Graph.Inductive (labNodes)
|
||||
import Data.Graph.Inductive (labNodes,labEdges)
|
||||
import Data.List (nubBy)
|
||||
import Data.Traversable
|
||||
import Control.Lens
|
||||
@@ -46,8 +46,10 @@ generateLevelFromRoomList gr' w = initWallZoning
|
||||
, _pathGraph = path
|
||||
, _pathGraphP = pairPath
|
||||
}
|
||||
& phZoning %~ \zn -> foldl' (flip $ updateZoning (:)) (zn & znObjects .~ mempty)
|
||||
(labNodes (_pgGraph path))
|
||||
& pnZoning %~ (\zn -> foldl' (flip $ updateZoning (:)) (zn & znObjects .~ mempty)
|
||||
(labNodes (_pgGraph path)))
|
||||
& peZoning %~ (\zn -> foldl' (flip $ updateZoning (:)) (zn & znObjects .~ mempty)
|
||||
(labEdges (_pgGraph path)))
|
||||
where
|
||||
path = pairsToGraph'' pairPath
|
||||
pairPath = foldMap _rmPath rs
|
||||
|
||||
Reference in New Issue
Block a user