Add Store instances
This commit is contained in:
@@ -14,6 +14,8 @@ The warnings have been disabled.
|
||||
-}
|
||||
module Dodge.Data.PathGraph where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import LinearHelp ()
|
||||
@@ -44,7 +46,6 @@ data PathEdge = PathEdge
|
||||
, _peObstacles :: Set.Set EdgeObstacle
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary PathEdge
|
||||
|
||||
instance ToJSON PathEdge where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
@@ -57,7 +58,7 @@ data EdgeObstacle
|
||||
| AutoDoorObstacle
|
||||
| WallObstacle
|
||||
deriving (Eq, Ord, Show, Read, Bounded, Enum, Generic, Flat)
|
||||
instance Binary EdgeObstacle
|
||||
$($(derive [d| instance Deriving (Store EdgeObstacle) |]))
|
||||
|
||||
instance ToJSON EdgeObstacle where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
@@ -73,3 +74,5 @@ deriving instance (Flat (Gr Point2 PathEdge))
|
||||
|
||||
makeLenses ''PathGraph
|
||||
makeLenses ''PathEdge
|
||||
$($(derive [d| instance Deriving (Store PathEdge ) |]))
|
||||
$($(derive [d| instance Deriving (Store (Gr Point2 PathEdge) ) |]))
|
||||
|
||||
Reference in New Issue
Block a user