Implement simple sweep light

This commit is contained in:
2021-09-26 23:38:32 +01:00
parent c0480f0ad6
commit d9ad55ec50
6 changed files with 66 additions and 5 deletions
+12
View File
@@ -70,6 +70,7 @@ placeSpots pss w = foldr (placeSpot . _placementSpot) w' singlePlacements
{- | -}
placeSpot :: PlacementSpot -> World -> World
placeSpot ps w = case _psType ps of
PutProp prop -> placeProp prop p rot w
PutButton bt -> placeBt bt p rot w
PutFlIt itm -> placeFlIt itm p rot w
PutCrit cr -> placeCr cr p rot w
@@ -146,6 +147,17 @@ addPane wl (p0,p1) wls = IM.insert (IM.newKey wls) (wl
})
wls
-- TODO make rotation of props sensible
placeProp
:: Prop
-> Point2
-> Float -- ^ Rotation
-> World
-> World
placeProp pr p a = over props addProp
where
addProp prs = IM.insert (IM.newKey prs) (over pjRot (+a) pr {_pjPos = p, _pjID = IM.newKey prs}) prs
placeBt
:: Button
-> Point2