Transition to new room datatypes, first separate out/inlinks

This commit is contained in:
2021-11-23 17:27:33 +00:00
parent 67b0d694af
commit 0f4040807a
19 changed files with 119 additions and 87 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ posRms bounds (parent,_) _ [] st = case st of
-> fmap (finalLinksUpdate parent:) <$> posRms bounds childi 0 ts tseq
posRms bounds parenti numChild (t@(Node childi _):ts) tseq = do
printInfo parenti numChild childi
tryLinks (0::Int) (init $ _rmLinks parent)
tryLinks (0::Int) (_rmOutLinks parent)
where
parent = fst parenti
tryLinks _ [] = putStrLn "all links tried" >> return Nothing
@@ -53,7 +53,7 @@ posRms bounds parenti numChild (t@(Node childi _):ts) tseq = do
where
convexBounds = map pointsToPoly $ _rmBound r'
clipping = or (convexPolysOverlap <$> convexBounds <*> bounds)
upr rm = doLnkEff l $ rm & rmLinks %~ delete l & rmPos %~ (uncurry (UsedOutLink numChild) l :)
upr rm = doLnkEff l $ rm & rmOutLinks %~ delete l & rmPos %~ (uncurry (UsedOutLink numChild) l :)
l' = shiftLinkBy (_rmShift parent) l
r' = doRoomShift . fst $ rootLabel shiftedt
shiftedt = applyToRoot (first $ shiftRoomShiftToLink l') t