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
+6 -4
View File
@@ -5,6 +5,8 @@
module Dodge.Data.Prop where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Color
@@ -41,7 +43,6 @@ data Prop
, _prToggle :: Bool
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Prop
data PropDraw
= PropDrawSPic SPic
@@ -54,7 +55,6 @@ data PropDraw
| PropDrawToggle PropDraw
| PropDrawGib Float
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary PropDraw
data PropUpdate
= PropUpdateAnd PropUpdate PropUpdate
@@ -69,17 +69,19 @@ data PropUpdate
| PropUpdateWhen WdBl PropUpdate
| PropUpdateIf WdBl PropUpdate PropUpdate
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary PropUpdate
data PrWdLsLs
= PrWdLsId
| PrWdLsSetPosition WdP2f Point3
| PrWdLsSetColor Point3
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary PrWdLsLs
makeLenses ''Prop
deriveJSON defaultOptions ''PropDraw
deriveJSON defaultOptions ''PropUpdate
deriveJSON defaultOptions ''PrWdLsLs
deriveJSON defaultOptions ''Prop
$($(derive [d| instance Deriving (Store Prop) |]))
$($(derive [d| instance Deriving (Store PropDraw) |]))
$($(derive [d| instance Deriving (Store PropUpdate) |]))
$($(derive [d| instance Deriving (Store PrWdLsLs) |]))