Move from store to flat
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
{-# LANGUAGE StandaloneDeriving #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
{-# LANGUAGE FlexibleInstances #-}
|
||||
@@ -11,6 +14,7 @@ The warnings have been disabled.
|
||||
-}
|
||||
module Dodge.Data.PathGraph where
|
||||
|
||||
import Flat
|
||||
import LinearHelp
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
@@ -42,7 +46,7 @@ data PathEdge = PathEdge
|
||||
, _peDist :: Float
|
||||
, _peObstacles :: Set.Set EdgeObstacle
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
|
||||
instance ToJSON PathEdge where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
@@ -54,7 +58,7 @@ data EdgeObstacle
|
||||
| DoorObstacle
|
||||
| AutoDoorObstacle
|
||||
| WallObstacle
|
||||
deriving (Eq, Ord, Show, Read, Bounded, Enum, Generic)
|
||||
deriving (Eq, Ord, Show, Read, Bounded, Enum, Generic, Flat)
|
||||
|
||||
instance ToJSON EdgeObstacle where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
@@ -66,17 +70,7 @@ instance (ToJSON a, ToJSON b) => ToJSON (Gr a b) where
|
||||
|
||||
instance (FromJSON a, FromJSON b) => FromJSON (Gr a b)
|
||||
|
||||
deriving instance (Flat (Gr Point2 PathEdge))
|
||||
|
||||
makeLenses ''PathGraph
|
||||
makeLenses ''PathEdge
|
||||
|
||||
{- FOURMOLU_DISABLE -}
|
||||
$($(derive [d|
|
||||
instance Deriving (Store EdgeObstacle)
|
||||
|]))
|
||||
$($(derive [d|
|
||||
instance Deriving (Store PathEdge)
|
||||
|]))
|
||||
$($(derive [d|
|
||||
instance Deriving (Store (Gr Point2 PathEdge))
|
||||
|]))
|
||||
{- FOURMOLU_ENABLE -}
|
||||
|
||||
Reference in New Issue
Block a user