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
+7 -4
View File
@@ -8,6 +8,8 @@ module Dodge.Data.Wall (
module Dodge.Data.Material,
) where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import LinearHelp ()
@@ -38,7 +40,6 @@ data Wall = Wall
, _wlMaterial :: Material
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Wall
data Opacity
= SeeThrough
@@ -46,11 +47,10 @@ data Opacity
| DrawnWall {_opDraw :: WallDraw} -- Wall -> SPic
| Opaque
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Opacity
data WallDraw = DrawForceField
| HackWallDraw
deriving (Eq, Ord, Show, Read, Enum, Bounded, Generic, Flat)
instance Binary WallDraw
data WallStructure
= StandaloneWall
@@ -61,7 +61,6 @@ data WallStructure
{ _wlStCreature :: Int
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary WallStructure
makeLenses ''Wall
makeLenses ''Opacity
@@ -70,3 +69,7 @@ deriveJSON defaultOptions ''Wall
deriveJSON defaultOptions ''Opacity
deriveJSON defaultOptions ''WallDraw
deriveJSON defaultOptions ''WallStructure
$($(derive [d| instance Deriving (Store Wall ) |]))
$($(derive [d| instance Deriving (Store Opacity) |]))
$($(derive [d| instance Deriving (Store WallDraw ) |]))
$($(derive [d| instance Deriving (Store WallStructure) |]))