Add Binary instances

This commit is contained in:
2022-08-21 10:58:19 +01:00
parent 386a2b4732
commit 1ce7d4a72d
95 changed files with 345 additions and 3 deletions
+5
View File
@@ -5,6 +5,7 @@
module Dodge.Data.Prop where
import Data.Binary
import Flat
import Color
import Control.Lens
@@ -40,6 +41,7 @@ data Prop
, _prToggle :: Bool
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Prop
data PropDraw
= PropDrawSPic SPic
@@ -52,6 +54,7 @@ data PropDraw
| PropDrawToggle PropDraw
| PropDrawGib Float
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary PropDraw
data PropUpdate
= PropUpdateAnd PropUpdate PropUpdate
@@ -66,12 +69,14 @@ 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