Continue placement refactor

This commit is contained in:
2021-09-28 15:44:32 +01:00
parent b8af2ce9d8
commit 6b937b115e
10 changed files with 46 additions and 78 deletions
+5 -9
View File
@@ -49,16 +49,12 @@ data PlacementSpot = PS
, _psRot :: Float
, _psType :: PSType
}
data Placement
= SimplePlacement {_placementSpot :: PlacementSpot }
| IDPlacement {_placementSpot :: PlacementSpot, _idPlacement :: Int -> Placement }
-- | GroupedPlacement
-- {_groupPlacementID :: Int
-- ,_groupUpdate :: World -> [Placement] -> World
-- ,_placementSpot :: PlacementSpot
-- }
data Placement = Placement
{ _placementSpot :: PlacementSpot
, _idPlacement :: Int -> Maybe Placement
}
sPS :: Point2 -> Float -> PSType -> Placement
sPS p a = SimplePlacement . PS p a
sPS p a pt = Placement (PS p a pt) (const Nothing)
makeLenses ''PSType
makeLenses ''PlacementSpot
makeLenses ''Placement
+11 -11
View File
@@ -2,17 +2,17 @@ module Dodge.LevelGen.SwarmPlacement
( --swarmPS
)
where
import Dodge.Data
import Dodge.LevelGen.Data
import Dodge.Creature.State.Data
--import Geometry
import Geometry.ConvexPoly
import Geometry.Data
import qualified IntMapHelp as IM
import Data.List
import qualified Data.IntSet as IS
import Control.Lens
--import Dodge.Data
--import Dodge.LevelGen.Data
--import Dodge.Creature.State.Data
----import Geometry
--import Geometry.ConvexPoly
--import Geometry.Data
--import qualified IntMapHelp as IM
--
--import Data.List
--import qualified Data.IntSet as IS
--import Control.Lens
--swarmPS :: Int -> Point2 -> Float -> Creature -> Placement
--swarmPS i p a cr = GroupedPlacement