Commit before placement refactor

This commit is contained in:
2021-09-28 14:55:22 +01:00
parent 751000636e
commit b8af2ce9d8
16 changed files with 134 additions and 331 deletions
+11 -9
View File
@@ -14,8 +14,9 @@ module Dodge.LevelGen.Data
, pwPoly
, pwWall
, unPutCrit
, groupPlacementID
, groupUpdate
-- , groupPlacementID
-- , groupUpdate
, idPlacement
) where
import Dodge.Data
import Picture
@@ -49,14 +50,15 @@ data PlacementSpot = PS
, _psType :: PSType
}
data Placement
= SinglePlacement {_placementSpot :: PlacementSpot }
| GroupedPlacement
{_groupPlacementID :: Int
,_groupUpdate :: World -> [Placement] -> World
,_placementSpot :: PlacementSpot
}
= SimplePlacement {_placementSpot :: PlacementSpot }
| IDPlacement {_placementSpot :: PlacementSpot, _idPlacement :: Int -> Placement }
-- | GroupedPlacement
-- {_groupPlacementID :: Int
-- ,_groupUpdate :: World -> [Placement] -> World
-- ,_placementSpot :: PlacementSpot
-- }
sPS :: Point2 -> Float -> PSType -> Placement
sPS p a = SinglePlacement . PS p a
sPS p a = SimplePlacement . PS p a
makeLenses ''PSType
makeLenses ''PlacementSpot
makeLenses ''Placement