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
+5 -5
View File
@@ -168,14 +168,14 @@ gameRoomFromRoom rm = GameRoom
[p +.+ 10 *.* unitVectorAtAngle a
,p -.- 10 *.* unitVectorAtAngle a
]
unpos (OutLink _ p a) = doubleShift p a
unpos (InLink p a) = doubleShift p a
unpos (UsedOutLink _ p a) = doubleShift p a
unpos (UsedInLink p a) = doubleShift p a
unpos _ = []
undir (OutLink _ _ a) = Just $ 0.5*pi + a + snd (_rmShift rm)
undir (InLink _ a) = Just $ 0.5*pi + a + snd (_rmShift rm)
undir (UsedOutLink _ _ a) = Just $ 0.5*pi + a + snd (_rmShift rm)
undir (UsedInLink _ a) = Just $ 0.5*pi + a + snd (_rmShift rm)
undir _ = Nothing
closePoints x y = roundPoint2 x == roundPoint2 y
getDir (InLink _ a:_) = a + snd (_rmShift rm)
getDir (UsedInLink _ a:_) = a + snd (_rmShift rm)
getDir (_:xs) = getDir xs
getDir _ = 0 -- fallback