Move from store to flat

This commit is contained in:
2022-08-20 17:54:35 +01:00
parent 8571ab9254
commit ff9dbdf068
95 changed files with 793 additions and 748 deletions
+7 -7
View File
@@ -1,3 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -7,12 +9,13 @@ module Dodge.Data.Block (
module Dodge.Data.PathGraph,
) where
import Flat
import LinearHelp
import Color
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import qualified Data.IntSet as IS
import qualified IntSetHelp as IS
import Dodge.Data.Material
import Dodge.Data.PathGraph
import Geometry
@@ -33,24 +36,21 @@ data Block = Block
, _blDraw :: BlockDraw --Block -> SPic
, _blObstructs :: [(Int, Int, PathEdge)]
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data BlockDraw
= BlockDrawMempty
| BlockDrawBlSh BlSh
| BlockDraws [BlockDraw]
| BlockDrawColHeightPoss Color Float [Point2]
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data BlSh
= BlShMempty
| BlShConst Shape
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
makeLenses ''Block
deriveJSON defaultOptions ''Block
deriveJSON defaultOptions ''BlockDraw
deriveJSON defaultOptions ''BlSh
$($(derive [d| instance Deriving (Store Block) |]))
$($(derive [d| instance Deriving (Store BlockDraw) |]))
$($(derive [d| instance Deriving (Store BlSh) |]))