Make Placement into a product type
This commit is contained in:
@@ -135,14 +135,13 @@ lnkBothAnd rlt ltcon ltcon2 i (j, (p, a)) =
|
||||
{- Creates a rectangular room, automatically creates links and pathfinding graph at a sensible size. -}
|
||||
-- it is not clear to me that this works for very small rooms (but it does seem
|
||||
-- to do so)
|
||||
roomRectAutoLinks :: Float -> Float -> Room
|
||||
roomRectAutoLinks x y =
|
||||
roomRect x y (f x) (f y)
|
||||
roomRectAutoLinks :: RandomGen g => Float -> Float -> State g Room
|
||||
roomRectAutoLinks x y = do
|
||||
l1 <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isInLnk rp
|
||||
l2 <- mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp
|
||||
return $ roomRect x y (f x) (f y)
|
||||
& rmName .~ "autoRect"
|
||||
& rmPmnts
|
||||
.~ [ mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isInLnk rp
|
||||
, mntLightLnkCond $ resetPLUse $ rprBool $ \rp _ -> isOutLnk rp
|
||||
]
|
||||
& rmPmnts .~ [ l1 , l2 ]
|
||||
where
|
||||
f z = max 1 $ (ceiling z - 40) `div` 60
|
||||
|
||||
|
||||
Reference in New Issue
Block a user