Remove outplacements

This commit is contained in:
2025-09-23 17:14:30 +01:00
parent a6ca90d7d8
commit 60fdd138e3
4 changed files with 16 additions and 17 deletions
+14 -14
View File
@@ -37,7 +37,7 @@ generateLevelFromRoomList gr' w =
. over gwWorld setupWorldBounds
-- . over (gwWorld . cWorld . lWorld) initItemLocations
. doInPlacements
. doOutPlacements
-- . doOutPlacements
. doIndividualPlacements
. setTiles
. worldToGenWorld rs'
@@ -88,20 +88,20 @@ doRoomInPlacements w rm = foldr f (w, rm) $ _rmInPmnt rm
where
f plf (w', r') = fst $ placeSpot (w', r') (plf (w'))
doOutPlacements :: GenWorld -> GenWorld
doOutPlacements w =
let ((pmnts, gw), rms) = mapAccumR doRoomOutPlacements (IM.empty, w) (_genRooms w)
in gw & genRooms .~ rms & genPmnt <>~ pmnts
--doOutPlacements :: GenWorld -> GenWorld
--doOutPlacements w =
-- let ((pmnts, gw), rms) = mapAccumR doRoomOutPlacements (IM.empty, w) (_genRooms w)
-- in gw & genRooms .~ rms & genPmnt <>~ pmnts
doRoomOutPlacements ::
(IM.IntMap [Placement], GenWorld) ->
Room ->
((IM.IntMap [Placement], GenWorld), Room)
doRoomOutPlacements imw r = foldr f (imw, r) $ IM.toList $ _rmOutPmnt r
where
f (i, pl) ((im, w), rm) =
let ((neww, newrm), plmnts) = placeSpot (w, rm) pl
in ((IM.insert i plmnts im, neww), newrm)
--doRoomOutPlacements ::
-- (IM.IntMap [Placement], GenWorld) ->
-- Room ->
-- ((IM.IntMap [Placement], GenWorld), Room)
--doRoomOutPlacements imw r = foldr f (imw, r) $ IM.toList $ _rmOutPmnt r
-- where
-- f (i, pl) ((im, w), rm) =
-- let ((neww, newrm), plmnts) = placeSpot (w, rm) pl
-- in ((IM.insert i plmnts im, neww), newrm)
doIndividualPlacements :: GenWorld -> GenWorld
doIndividualPlacements gw =