Add Binary instances
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user