Remove outplacements
This commit is contained in:
@@ -107,7 +107,7 @@ data Room = Room
|
|||||||
, _rmPath :: S.Set (Point2, Point2)
|
, _rmPath :: S.Set (Point2, Point2)
|
||||||
, _rmPmnts :: [Placement]
|
, _rmPmnts :: [Placement]
|
||||||
, _rmInPmnt :: [GenWorld -> Placement]
|
, _rmInPmnt :: [GenWorld -> Placement]
|
||||||
, _rmOutPmnt :: IM.IntMap Placement
|
-- , _rmOutPmnt :: IM.IntMap Placement
|
||||||
, _rmBound :: [[Point2]]
|
, _rmBound :: [[Point2]]
|
||||||
, _rmFloor :: Floor
|
, _rmFloor :: Floor
|
||||||
, _rmName :: String
|
, _rmName :: String
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ defaultRoom =
|
|||||||
, _rmPath = mempty
|
, _rmPath = mempty
|
||||||
, _rmPmnts = mempty
|
, _rmPmnts = mempty
|
||||||
, _rmInPmnt = mempty
|
, _rmInPmnt = mempty
|
||||||
, _rmOutPmnt = mempty
|
-- , _rmOutPmnt = mempty
|
||||||
, _rmBound = mempty
|
, _rmBound = mempty
|
||||||
, _rmFloor = InheritFloor
|
, _rmFloor = InheritFloor
|
||||||
, _rmName = "defaultRoom"
|
, _rmName = "defaultRoom"
|
||||||
|
|||||||
+14
-14
@@ -37,7 +37,7 @@ generateLevelFromRoomList gr' w =
|
|||||||
. over gwWorld setupWorldBounds
|
. over gwWorld setupWorldBounds
|
||||||
-- . over (gwWorld . cWorld . lWorld) initItemLocations
|
-- . over (gwWorld . cWorld . lWorld) initItemLocations
|
||||||
. doInPlacements
|
. doInPlacements
|
||||||
. doOutPlacements
|
-- . doOutPlacements
|
||||||
. doIndividualPlacements
|
. doIndividualPlacements
|
||||||
. setTiles
|
. setTiles
|
||||||
. worldToGenWorld rs'
|
. worldToGenWorld rs'
|
||||||
@@ -88,20 +88,20 @@ doRoomInPlacements w rm = foldr f (w, rm) $ _rmInPmnt rm
|
|||||||
where
|
where
|
||||||
f plf (w', r') = fst $ placeSpot (w', r') (plf (w'))
|
f plf (w', r') = fst $ placeSpot (w', r') (plf (w'))
|
||||||
|
|
||||||
doOutPlacements :: GenWorld -> GenWorld
|
--doOutPlacements :: GenWorld -> GenWorld
|
||||||
doOutPlacements w =
|
--doOutPlacements w =
|
||||||
let ((pmnts, gw), rms) = mapAccumR doRoomOutPlacements (IM.empty, w) (_genRooms w)
|
-- let ((pmnts, gw), rms) = mapAccumR doRoomOutPlacements (IM.empty, w) (_genRooms w)
|
||||||
in gw & genRooms .~ rms & genPmnt <>~ pmnts
|
-- in gw & genRooms .~ rms & genPmnt <>~ pmnts
|
||||||
|
|
||||||
doRoomOutPlacements ::
|
--doRoomOutPlacements ::
|
||||||
(IM.IntMap [Placement], GenWorld) ->
|
-- (IM.IntMap [Placement], GenWorld) ->
|
||||||
Room ->
|
-- Room ->
|
||||||
((IM.IntMap [Placement], GenWorld), Room)
|
-- ((IM.IntMap [Placement], GenWorld), Room)
|
||||||
doRoomOutPlacements imw r = foldr f (imw, r) $ IM.toList $ _rmOutPmnt r
|
--doRoomOutPlacements imw r = foldr f (imw, r) $ IM.toList $ _rmOutPmnt r
|
||||||
where
|
-- where
|
||||||
f (i, pl) ((im, w), rm) =
|
-- f (i, pl) ((im, w), rm) =
|
||||||
let ((neww, newrm), plmnts) = placeSpot (w, rm) pl
|
-- let ((neww, newrm), plmnts) = placeSpot (w, rm) pl
|
||||||
in ((IM.insert i plmnts im, neww), newrm)
|
-- in ((IM.insert i plmnts im, neww), newrm)
|
||||||
|
|
||||||
doIndividualPlacements :: GenWorld -> GenWorld
|
doIndividualPlacements :: GenWorld -> GenWorld
|
||||||
doIndividualPlacements gw =
|
doIndividualPlacements gw =
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ module Dodge.Room.RunPast (
|
|||||||
lockedStart,
|
lockedStart,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import qualified Data.IntMap.Strict as IM
|
|
||||||
import Color
|
import Color
|
||||||
import qualified Data.Set as S
|
import qualified Data.Set as S
|
||||||
import Dodge.Cleat
|
import Dodge.Cleat
|
||||||
|
|||||||
Reference in New Issue
Block a user