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
+4
View File
@@ -9,6 +9,7 @@ module Dodge.Data.Block (
module Dodge.Data.PathGraph,
) where
import Data.Binary
import Flat
import LinearHelp ()
import Color
@@ -35,6 +36,7 @@ data Block = Block
, _blObstructs :: [(Int, Int, PathEdge)]
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary Block
data BlockDraw
= BlockDrawMempty
@@ -42,11 +44,13 @@ 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