Simplify block drawing further, store shape of block

This commit is contained in:
2025-10-24 19:39:44 +01:00
parent ffea3a1694
commit 95b4105f52
9 changed files with 143 additions and 163 deletions
+15 -14
View File
@@ -7,7 +7,7 @@ module Dodge.Data.Block (
module Dodge.Data.PathGraph,
) where
import Color
--import Color
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -26,22 +26,23 @@ data Block = Block
, _blPos :: Point2
, _blDir :: Float
, _blHeight :: Float
, _blDraw :: BlockDraw
-- , _blDraw :: BlockDraw
, _blDraw :: Shape
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data BlockDraw
= BlockDrawMempty
| BlockDrawBlSh Shape
| BlockDraws [BlockDraw]
| BlockDrawColHeightPoss Color Float [Point2]
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data BlSh
= BlShConst Shape
deriving (Eq, Ord, Show, Read) --Generic, Flat)
--data BlockDraw
-- = BlockDrawMempty
-- | BlockDrawBlSh Shape
---- | BlockDraws [BlockDraw]
---- | BlockDrawColHeightPoss Color Float [Point2]
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
--
--data BlSh
-- = BlShConst Shape
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''Block
deriveJSON defaultOptions ''BlSh
deriveJSON defaultOptions ''BlockDraw
--deriveJSON defaultOptions ''BlSh
--deriveJSON defaultOptions ''BlockDraw
deriveJSON defaultOptions ''Block