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
+3
View File
@@ -14,6 +14,7 @@ The warnings have been disabled.
-}
module Dodge.Data.PathGraph where
import Data.Binary
import Flat
import LinearHelp ()
import Control.Lens
@@ -43,6 +44,7 @@ data PathEdge = PathEdge
, _peObstacles :: Set.Set EdgeObstacle
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary PathEdge
instance ToJSON PathEdge where
toEncoding = genericToEncoding defaultOptions
@@ -55,6 +57,7 @@ data EdgeObstacle
| AutoDoorObstacle
| WallObstacle
deriving (Eq, Ord, Show, Read, Bounded, Enum, Generic, Flat)
instance Binary EdgeObstacle
instance ToJSON EdgeObstacle where
toEncoding = genericToEncoding defaultOptions