Redo PathFrom name change
This commit is contained in:
@@ -61,12 +61,12 @@ data RPLinkStatus
|
||||
| UnusedLink { _rplsType :: S.Set RoomLinkType }
|
||||
| NotLink
|
||||
deriving (Eq,Ord,Show)
|
||||
data PathEdge = PathFromEdge CardinalPoint Int
|
||||
data PathFromEdge = PathFromEdge CardinalPoint Int
|
||||
deriving (Eq,Ord,Show)
|
||||
|
||||
data RoomPosType
|
||||
= RoomPosOnPath {_onPathEdges :: S.Set PathEdge}
|
||||
| RoomPosOffPath {_offPathEdges :: S.Set PathEdge}
|
||||
= RoomPosOnPath {_onPathFromEdges :: S.Set PathFromEdge}
|
||||
| RoomPosOffPath {_offPathFromEdges :: S.Set PathFromEdge}
|
||||
| RoomPosExLink
|
||||
| RoomPosLab Int
|
||||
deriving (Eq,Ord,Show)
|
||||
|
||||
@@ -3,8 +3,8 @@ module Dodge.PlacementSpot
|
||||
( atFstLnkOut
|
||||
, rpIsOnPath
|
||||
, rpIsOffPath
|
||||
, rpOffPathEdge
|
||||
, rpOnPathEdge
|
||||
, rpOffPathFromEdge
|
||||
, rpOnPathFromEdge
|
||||
, useUnusedLnk
|
||||
, psRandRanges
|
||||
, useRoomPosCond
|
||||
@@ -82,16 +82,16 @@ rpIsOffPath = any f . _rpType
|
||||
where
|
||||
f RoomPosOffPath {} = True
|
||||
f _ = False
|
||||
rpOffPathEdge :: PathEdge -> RoomPos -> Bool
|
||||
rpOffPathEdge pe = any f . _rpType
|
||||
rpOffPathFromEdge :: PathFromEdge -> RoomPos -> Bool
|
||||
rpOffPathFromEdge pe = any f . _rpType
|
||||
where
|
||||
f rt = maybe False (pe `elem`) (rt ^? offPathEdges)
|
||||
f rt = maybe False (pe `elem`) (rt ^? offPathFromEdges)
|
||||
|
||||
-- test whether a roomPos is on the path with a given from edge value
|
||||
rpOnPathEdge :: PathEdge -> RoomPos -> Bool
|
||||
rpOnPathEdge pe = any f . _rpType
|
||||
rpOnPathFromEdge :: PathFromEdge -> RoomPos -> Bool
|
||||
rpOnPathFromEdge pe = any f . _rpType
|
||||
where
|
||||
f rt = maybe False (pe `elem`) (rt ^? onPathEdges)
|
||||
f rt = maybe False (pe `elem`) (rt ^? onPathFromEdges)
|
||||
|
||||
resetPLUse :: PlacementSpot -> PlacementSpot
|
||||
resetPLUse (PSPos f g fallback) = PSPos f' g fallback
|
||||
|
||||
@@ -24,8 +24,8 @@ blockPillar w' h' = ps0jPushPS (aline tl tr)
|
||||
$ ps0jPushPS (aline br bl)
|
||||
$ sps0 (aline bl tl)
|
||||
where
|
||||
w = w' - 9
|
||||
h = h' - 9
|
||||
w = w' - 10
|
||||
h = h' - 10
|
||||
tl = V2 (-w) h
|
||||
tr = V2 w h
|
||||
br = V2 w (-h)
|
||||
@@ -70,7 +70,7 @@ roomPillarsSquare = do
|
||||
where
|
||||
makepill edge = sps (rprBool $ \rp _ -> t edge rp) smallPillar
|
||||
t edge rp = any (f edge) (_rpType rp) && _rpPlacementUse rp == 0
|
||||
f edge rpt = maybe False (PathFromEdge edge 0 `S.member`) (rpt ^? offPathEdges)
|
||||
f edge rpt = maybe False (PathFromEdge edge 0 `S.member`) (rpt ^? offPathFromEdges)
|
||||
|
||||
roomPillarsPassage :: RandomGen g => State g Room
|
||||
roomPillarsPassage = do
|
||||
|
||||
@@ -42,7 +42,7 @@ randEdgeTank = do
|
||||
<> horPipe 80 0 (70 *.* cardVec edge))))
|
||||
-- 70 is a guess, the true value depends on the distance to the wall
|
||||
& plSpot .~ rprBool (\rp _ -> _rpPlacementUse rp == 0
|
||||
&& rpOffPathEdge (PathFromEdge edge 0) rp)
|
||||
&& rpOffPathFromEdge (PathFromEdge edge 0) rp)
|
||||
|
||||
randEdgeTanks :: RandomGen g => Int -> State g [Placement]
|
||||
randEdgeTanks i = do
|
||||
@@ -54,7 +54,7 @@ randEdgeTanks i = do
|
||||
<> horPipe 80 0 (70 *.* cardVec edge))))
|
||||
-- 70 is a guess, the true value depends on the distance to the wall
|
||||
& plSpot .~ rprBool (\rp _ -> _rpPlacementUse rp == 0
|
||||
&& rpOffPathEdge (PathFromEdge edge 0) rp)
|
||||
&& rpOffPathFromEdge (PathFromEdge edge 0) rp)
|
||||
|
||||
tanksPipesRoom :: RandomGen g => State g Room
|
||||
tanksPipesRoom = do
|
||||
|
||||
Reference in New Issue
Block a user