Simplify room link functions
This commit is contained in:
+11
-5
@@ -87,8 +87,10 @@ posRms prs parenti@(parent, _) ((numChild, t@(Node childi _)) : its) tseq = do
|
||||
& rmLinks %~ delete outlnk
|
||||
& rmPos
|
||||
.:~ RoomPos
|
||||
{ _rpPos = fst (lnkPosDir outlnk)
|
||||
, _rpDir = snd (lnkPosDir outlnk)
|
||||
--{ _rpPos = fst (lnkPosDir outlnk)
|
||||
--, _rpDir = snd (lnkPosDir outlnk)
|
||||
{ _rpPos = outlnk ^. rlPos
|
||||
, _rpDir = outlnk ^. rlDir
|
||||
, _rpType = S.empty
|
||||
, _rpLinkStatus = UsedOutLink (_rlType outlnk) numChild (snd childi)
|
||||
, _rpPlacementUse = mempty
|
||||
@@ -102,8 +104,10 @@ posRms prs parenti@(parent, _) ((numChild, t@(Node childi _)) : its) tseq = do
|
||||
& rmLinks %~ delete il
|
||||
& rmPos
|
||||
.:~ RoomPos
|
||||
{ _rpPos = fst (lnkPosDir il)
|
||||
, _rpDir = snd (lnkPosDir il)
|
||||
--{ _rpPos = fst (lnkPosDir outlnk)
|
||||
--, _rpDir = snd (lnkPosDir outlnk)
|
||||
{ _rpPos = outlnk ^. rlPos
|
||||
, _rpDir = outlnk ^. rlDir
|
||||
, _rpType = S.empty
|
||||
, _rpLinkStatus = UsedInLink (_rlType il) (snd parenti)
|
||||
, _rpPlacementUse = mempty
|
||||
@@ -111,7 +115,9 @@ posRms prs parenti@(parent, _) ((numChild, t@(Node childi _)) : its) tseq = do
|
||||
shiftedt =
|
||||
over
|
||||
root
|
||||
(first $ updatechild . shiftRoomShiftToLink (lnkPosDir shiftedoutlink) (lnkPosDir il))
|
||||
(first $ updatechild . shiftRoomShiftToLink
|
||||
(shiftedoutlink ^. rlPos, shiftedoutlink ^. rlDir)
|
||||
(il ^. rlPos, il ^. rlDir))
|
||||
t
|
||||
|
||||
createUnusedLinkPos :: Room -> Room
|
||||
|
||||
Reference in New Issue
Block a user