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
+5 -2
View File
@@ -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) ) |]))