Tweak room modification when creating link

This commit is contained in:
2022-06-02 22:04:20 +01:00
parent 024f72da20
commit 15d8b821d4
3 changed files with 21 additions and 8 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ import Dodge.Room.Link
import Dodge.Tree.Polymorphic
import Dodge.RoomLink
import Geometry.ConvexPoly
import Geometry.Data
--import Geometry.Data
import Padding
import LensHelp hiding (Empty, (<|) , (|>))
--import Control.Lens hiding (Empty, (<|) , (|>))
@@ -78,7 +78,7 @@ posRms prs parenti@(parent,_) ( (numChild,t@(Node childi _) ):its) tseq = do
where
newBounds = map pointsToPoly . _rmBound . doRoomShift . fst $ rootLabel shiftedt
clipping = or (convexPolysOverlap <$> newBounds <*> _prBounds prs)
updateparent rm = doLnkEff (lnkPosDir outlnk) $ rm
updateparent rm = doLnkEff outlnk $ rm
& rmLinks %~ delete outlnk
& rmPos .:~ RoomPos
{ _rpPos = fst (lnkPosDir outlnk)
@@ -151,7 +151,7 @@ printInfoCheckNum (parentrm,parenti) childn (childrm,childi) = printPartialColum
0 -> _rmName parentrm ++ "-" ++ show parenti
_ -> ""
doLnkEff :: (Point2,Float) -> Room -> Room
doLnkEff :: RoomLink -> Room -> Room
doLnkEff x rm = case _rmLinkEff rm of
(eff:effs) -> eff x $ rm & rmLinkEff .~ effs
_ -> rm