Successfully stop reuse of link placement spots

This commit is contained in:
2021-11-09 17:24:01 +00:00
parent 5b09c9aa37
commit 9aefc11e17
2 changed files with 15 additions and 58 deletions
+1 -4
View File
@@ -41,8 +41,6 @@ generateLevelFromRoomList :: State StdGen [Room] -> World -> World
generateLevelFromRoomList gr w
= initWallZoning
. setupWorldBounds
-- . flip (foldr $ flip placeSpot) plmnts
-- . flip (foldl' placeSpot) plmnts
. flip (foldl' doRoomPlacements) rs
$ w { _walls = wallsFromRooms rs
, _floorTiles = floorsFromRooms rs
@@ -53,12 +51,11 @@ generateLevelFromRoomList gr w
where
path = pairsToGraph dist pairPath
pairPath = concatMap _rmPath rs
plmnts = concatMap (\rm -> map (rm,) (_rmPS rm)) rs
rs = zipWith addTile zs . evalState gr $ _randGen w
zs = map fromIntegral $ randomRs (0,63::Int) $ _randGen w
doRoomPlacements :: World -> Room -> World
doRoomPlacements w rm = fst $ foldl' placeSpot' (w,rm) $ _rmPS rm
doRoomPlacements w rm = fst $ foldl' placeSpot (w,rm) $ _rmPS rm
updatePSLnkUsing :: (Point2,Float) -> PlacementSpot -> PlacementSpot
updatePSLnkUsing pf PSLnk{_psLinkShift=f} = uncurry PS $ f pf