Pass room id rather than room during placement
This commit is contained in:
+7
-6
@@ -80,7 +80,7 @@ shuffleRoomPos rm = do
|
||||
return $ rm & rmPos .~ newPos
|
||||
|
||||
doInPlacements :: GenWorld -> GenWorld
|
||||
doInPlacements w = foldl' (\gw (i,(_,f)) -> placeSpot' i gw (f gw)) w
|
||||
doInPlacements w = foldl' (\gw (i,(_,f)) -> placeSpot i gw (f gw)) w
|
||||
. sortOn (fst.snd)
|
||||
$ foldMap g $ w ^. genRooms
|
||||
where
|
||||
@@ -97,15 +97,16 @@ doIndividualPlacements :: GenWorld -> GenWorld
|
||||
doIndividualPlacements gw = foldl' doRoomPlacements gw (_genRooms gw)
|
||||
|
||||
doRoomPlacements :: GenWorld -> Room -> GenWorld
|
||||
doRoomPlacements w rm = foldl' (placeSpot' i) (w & genRooms . ix i . rmPmnts .~ mempty)
|
||||
doRoomPlacements w rm = foldl' (placeSpot i) (w & genRooms . ix i . rmPmnts .~ mempty)
|
||||
$ _rmPmnts rm
|
||||
where
|
||||
i = rm ^?! rmMID . _Just
|
||||
|
||||
placeSpot' :: Int -> GenWorld -> Placement -> GenWorld
|
||||
placeSpot' i gw x =
|
||||
let (gw',r') = placeSpot (gw,(gw ^?! genRooms . ix i)) x
|
||||
in gw' & genRooms . ix i .~ r'
|
||||
--placeSpot' :: Int -> GenWorld -> Placement -> GenWorld
|
||||
--placeSpot' = placeSpot
|
||||
--placeSpot' i gw x =
|
||||
-- let (gw',r') = placeSpot (gw,(gw ^?! genRooms . ix i)) x
|
||||
-- in gw' & genRooms . ix i .~ r'
|
||||
|
||||
setupWorldBounds :: World -> World
|
||||
setupWorldBounds w =
|
||||
|
||||
Reference in New Issue
Block a user