Move from store to flat
This commit is contained in:
@@ -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) |]))
|
||||
|
||||
Reference in New Issue
Block a user