Commit before making out and in placements have ids

This commit is contained in:
2022-03-11 12:34:19 +00:00
parent 73a35bb3f1
commit 219e4e15ee
13 changed files with 166 additions and 179 deletions
+25 -22
View File
@@ -1,4 +1,26 @@
module Dodge.RoomLink where
module Dodge.RoomLink
( muout
, muin
, outLink
, inLink
, restrictLinkType
, overLnkType
, lnkPosDir
, overLnkPosDir
, toBothLnk
, rmInLinks
, rmOutLinks
, setOutLinksPD
, setOutLinksByType
, setInLinksPD
, restrictOutLinks
, restrictInLinks
, setInLinks
, setInLinksByType
, setLinkType
, getLinksOfType
, swapInOutLinks
) where
import Dodge.LevelGen.Data
import Geometry
@@ -21,12 +43,6 @@ restrictInLinks = over rmLinks . restrictLinkType InLink
restrictOutLinks :: ((Point2,Float) -> Bool) -> Room -> Room
restrictOutLinks f = rmLinks %~ restrictLinkType OutLink f
addLabelLink :: Int -> (RoomLink -> Bool) -> [RoomLink] -> [RoomLink]
addLabelLink i t = map f
where
f rl | t rl = rl & rlType %~ S.insert (LabLink i)
| otherwise = rl
setOutLinks :: (RoomLink -> Bool) -> [RoomLink] -> [RoomLink]
setOutLinks = setLinkType OutLink
@@ -93,24 +109,11 @@ inLink p a = RoomLink
,_rlPos = p
, _rlDir = a
}
lnkBothAnd :: RoomLinkType -> (Point2,Float) -> RoomLink
lnkBothAnd rlt (p,a) = RoomLink
{_rlType = S.fromList [OutLink,InLink,rlt]
,_rlPos = p
, _rlDir = a
}
lnkBothAnd' :: RoomLinkType -> (Int -> RoomLinkType) -> Int -> (Point2,Float) -> RoomLink
lnkBothAnd' rlt ltcon i (p,a) = RoomLink
{_rlType = S.fromList [OutLink,InLink,rlt,ltcon i]
,_rlPos = p
, _rlDir = a
}
toBothLnk :: (Point2,Float) -> RoomLink
toBothLnk (p,a) = RoomLink
{_rlType = S.fromList [OutLink,InLink]
,_rlPos = p
{ _rlType = S.fromList [OutLink,InLink]
, _rlPos = p
, _rlDir = a
}
muout :: [(Point2,Float)] -> [RoomLink]