Allow for multiple in links
This commit is contained in:
+12
-1
@@ -5,7 +5,8 @@ The last link in the list is considered the incoming link, the other links are
|
||||
the outgoing links. -}
|
||||
module Dodge.Room.Link
|
||||
( shiftRoomToLink
|
||||
, shiftRoomShiftToLink
|
||||
--, shiftRoomShiftToLink
|
||||
, shiftRoomShiftToLink'
|
||||
, shiftRoomBy
|
||||
, shiftLinkBy
|
||||
, doRoomShift
|
||||
@@ -98,6 +99,7 @@ shiftRoomToLink l r
|
||||
r
|
||||
where
|
||||
(p,a) = head $ _rmInLinks r
|
||||
|
||||
doRoomShift :: Room -> Room
|
||||
doRoomShift rm = shiftRoomBy (_rmShift rm) rm & rmShift .~ _rmShift rm
|
||||
|
||||
@@ -124,6 +126,15 @@ shiftRoomShiftToLink l r
|
||||
r
|
||||
where
|
||||
(p,a) = head $ _rmInLinks r
|
||||
|
||||
shiftRoomShiftToLink' :: (Point2,Float) -> (Point2,Float) -> Room -> Room
|
||||
shiftRoomShiftToLink' l inlink r
|
||||
= shiftRoomShiftBy l
|
||||
. shiftRoomShiftBy (V2 0 0 , pi-a)
|
||||
$ shiftRoomShiftBy (V2 0 0 -.- p , 0)
|
||||
r
|
||||
where
|
||||
(p,a) = inlink
|
||||
-- NOTE placements, when placed, will be shifted by the value _rmShift
|
||||
shiftRoomShiftBy :: (Point2,Float) -> Room -> Room
|
||||
shiftRoomShiftBy shift r = r
|
||||
|
||||
Reference in New Issue
Block a user