Use placement as continutation

This commit is contained in:
2021-11-13 09:26:20 +00:00
parent b243479759
commit 17c1a2152d
8 changed files with 35 additions and 21 deletions
+3 -3
View File
@@ -55,7 +55,7 @@ doPartialPlacement im rm w = case _rmPartialPmnt rm of
Nothing -> w
Just fi -> case _rmTakeFrom rm of
Nothing -> w
Just i -> fst $ placeSpot (w,rm) (fi (im IM.! i))
Just i -> fst $ fst $ placeSpot (w,rm) (fi (im IM.! i))
doExtendedPlacements :: [Room] -> World -> (IM.IntMap Int, World)
doExtendedPlacements rms w = foldr doExtendedPlacement (IM.empty,w) rms
@@ -65,10 +65,10 @@ doExtendedPlacement rm (im,w) = case _rmExtendedPmnt rm of
Nothing -> (im,w)
Just _ -> case _rmLabel rm of
Nothing -> (im,w)
Just _ -> undefined
Just i -> undefined
doRoomPlacements :: World -> Room -> World
doRoomPlacements w rm = fst $ foldl' placeSpot (w,rm) $ _rmPmnts rm
doRoomPlacements w rm = fst $ foldl' (\wr -> fst . placeSpot wr) (w,rm) $ _rmPmnts rm
setupWorldBounds :: World -> World
setupWorldBounds w = w