Add Store instances

This commit is contained in:
2022-08-21 12:21:05 +01:00
parent 1ce7d4a72d
commit dd62e30026
92 changed files with 465 additions and 255 deletions
+5 -3
View File
@@ -9,6 +9,8 @@ module Dodge.Data.Block (
module Dodge.Data.PathGraph,
) where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import LinearHelp ()
@@ -36,7 +38,6 @@ data Block = Block
, _blObstructs :: [(Int, Int, PathEdge)]
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Block
data BlockDraw
= BlockDrawMempty
@@ -44,15 +45,16 @@ data BlockDraw
| BlockDraws [BlockDraw]
| BlockDrawColHeightPoss Color Float [Point2]
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary BlockDraw
data BlSh
= BlShMempty
| BlShConst Shape
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary BlSh
makeLenses ''Block
deriveJSON defaultOptions ''Block
deriveJSON defaultOptions ''BlockDraw
deriveJSON defaultOptions ''BlSh
$($(derive [d| instance Deriving (Store BlSh) |]))
$($(derive [d| instance Deriving (Store Block ) |]))
$($(derive [d| instance Deriving (Store BlockDraw) |]))