Add indicator light to switch doors

This commit is contained in:
2021-11-16 12:57:13 +00:00
parent a7f2b5f3ea
commit f530952612
9 changed files with 117 additions and 20 deletions
+1 -14
View File
@@ -83,6 +83,7 @@ data Room = Room
}
data RoomWire
= RoomWire Point2 Float
| WallWire Point2 Float Float
data RoomPos
= OutLink Int Point2 Float
| InLink Point2 Float
@@ -104,20 +105,6 @@ makeLenses ''PSType
makeLenses ''PlacementSpot
makeLenses ''Placement
-- TODO rename to any unused link facing out
anyLnkOutPS :: PlacementSpot
anyLnkOutPS = PSLnk f (const id) Nothing
where
f (UnusedLink p a) = Just $ PS p a
f _ = Nothing
anyLnkInPS :: Float -- ^ amount to shift inward
-> PlacementSpot
anyLnkInPS x = PSLnk f (const id) Nothing
where
f (UnusedLink v a) = Just $ PS (v -.- x *.* unitVectorAtAngle (a + 0.5 * pi)) (a+ pi)
f _ = Nothing
spNoID :: PlacementSpot -> PSType -> Placement
spNoID ps pst = Placement ps pst Nothing (const Nothing)