Minor cleanup
This commit is contained in:
@@ -29,15 +29,16 @@ posRms :: [ConvexPoly]
|
||||
posRms _ _ [] Empty = return $ Just []
|
||||
posRms bounds (rtoadd,_) [] (Node (r,i) ts :<| tseq)
|
||||
= fmap (finalLinksUpdate rtoadd:) <$> posRms bounds (r,i) ts tseq
|
||||
posRms bounds (r,i) (t@(Node (_,i') _):ts) tseq = do
|
||||
posRms bounds (parent,i) (t@(Node (_,i') _):ts) tseq = do
|
||||
putStr $ "Trying to place room " ++ show i' ++ ": "
|
||||
tryLinks (0::Int) (_rmLinks $ doRoomShift r)
|
||||
--tryLinks (0::Int) (_rmLinks $ doRoomShift parent)
|
||||
tryLinks (0::Int) (_rmLinks parent)
|
||||
where
|
||||
tryLinks _ [] = do
|
||||
putStrLn "all links tried"
|
||||
return Nothing
|
||||
tryLinks j (l:ls)
|
||||
| clipping = tryLinks (j+1) ls
|
||||
| clipping = tryLinks (j+1) ls
|
||||
| otherwise = do
|
||||
putStrLn $ "placing at link " ++ show j
|
||||
mayrs <- posRms (convexBounds ++ bounds) newr ts (tseq |> shiftedt')
|
||||
@@ -47,10 +48,11 @@ posRms bounds (r,i) (t@(Node (_,i') _):ts) tseq = do
|
||||
where
|
||||
convexBounds = map pointsToPoly $ _rmBound r'
|
||||
clipping = or (convexPolysOverlap <$> convexBounds <*> bounds)
|
||||
newr = (lnkEff l $ r & rmLinks %~ delete l & rmPos %~ (uncurry (OutLink j) l :)
|
||||
newr = (lnkEff l $ parent & rmLinks %~ delete l & rmPos %~ (uncurry (OutLink j) l :)
|
||||
, i)
|
||||
(Node (r',_) _) = applyToRoot (first $ shiftRoomToLink l) t
|
||||
shiftedt' = applyToRoot (first $ shiftRoomShiftToLink l) t
|
||||
l' = shiftLinkBy (_rmShift parent) l
|
||||
(Node (r',_) _) = applyToRoot (first $ shiftRoomToLink l') t
|
||||
shiftedt' = applyToRoot (first $ shiftRoomShiftToLink l') t
|
||||
|
||||
lnkEff :: (Point2,Float) -> Room -> Room
|
||||
lnkEff x rm = case _rmLinkEff rm of
|
||||
|
||||
Reference in New Issue
Block a user