Introduce safeMinimumOn
This commit is contained in:
+5
-2
@@ -28,8 +28,8 @@ import Data.Graph.Inductive.Graph (labNodes)
|
||||
import qualified Data.Map as M
|
||||
|
||||
generateLevelFromRoomList :: State StdGen [Room] -> World -> World
|
||||
generateLevelFromRoomList gr w = initializeStaticWalls
|
||||
. updateWallZoning
|
||||
generateLevelFromRoomList gr w = updateWallZoning
|
||||
-- . initializeStaticWalls
|
||||
. placeSpots plmnts
|
||||
-- . addRoomPolyDecorations rs
|
||||
-- . addRoomLinkDecorations rs
|
||||
@@ -61,8 +61,11 @@ generateFromTree t w = updateWallZoning $ placeSpots plmnts
|
||||
|
||||
initializeStaticWalls :: World -> World
|
||||
initializeStaticWalls w = w & staticWalls %~ (\wls' -> foldr wallToWall wls' wls)
|
||||
& walls %~ IM.filter (not . wlIsWall)
|
||||
where
|
||||
wls = [wl | wl@Wall{} <- (IM.elems $ _walls w)]
|
||||
wlIsWall Wall{} = True
|
||||
wlIsWall _ = False
|
||||
|
||||
wallToWall :: Wall -> IM.IntMap (IM.IntMap [Wall']) -> IM.IntMap (IM.IntMap [Wall'])
|
||||
wallToWall wl wls = foldr f wls is
|
||||
|
||||
Reference in New Issue
Block a user