Define room link datatypes

This commit is contained in:
2021-11-23 13:00:34 +00:00
parent f51a6a7216
commit 67b0d694af
6 changed files with 25 additions and 14 deletions
+3 -3
View File
@@ -15,13 +15,13 @@ anyLnkOutPS = PSPos f (const id) Nothing
atFstLnkOut :: PlacementSpot
atFstLnkOut = PSPos f (const id) Nothing
where
f (OutLink 0 p a) = Just (PS p a, OutLink 0 p a)
f (UsedOutLink 0 p a) = Just (PS p a, UsedOutLink 0 p a)
f _ = Nothing
atNthLnkOutShiftBy :: Int -> ((Point2,Float) -> (Point2,Float)) -> PlacementSpot
atNthLnkOutShiftBy n theshift = PSPos f (const id) Nothing
where
f (OutLink i p a) | n == i = Just (PS p' a', OutLink n p a)
f (UsedOutLink i p a) | n == i = Just (PS p' a', UsedOutLink n p a)
where
(p',a') = theshift (p,a)
f _ = Nothing
@@ -40,7 +40,7 @@ atNthLnkOutShiftInward n x = atNthLnkOutShiftBy n f
overFstLnkOut :: PlacementSpot
overFstLnkOut = PSPos f (const id) Nothing
where
f (OutLink 0 p a) = Just (PS p a, PosPl p a)
f (UsedOutLink 0 p a) = Just (PS p a, PosPl p a)
f _ = Nothing
anyLnkInPS :: Float -- ^ amount to shift inward