Move from store to flat
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
@@ -8,11 +10,12 @@ module Dodge.Data.Door (
|
||||
module Dodge.Data.WorldEffect,
|
||||
) where
|
||||
|
||||
import Flat
|
||||
import LinearHelp
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import qualified Data.IntSet as IS
|
||||
import qualified IntSetHelp as IS
|
||||
import Dodge.Data.MountedObject
|
||||
import Dodge.Data.PathGraph
|
||||
import Dodge.Data.WorldEffect
|
||||
@@ -21,13 +24,13 @@ import TH.Derive
|
||||
import Data.Store
|
||||
|
||||
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
|
||||
data PushSource
|
||||
= PushesItself
|
||||
| PushedBy Int
|
||||
| NotPushed
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
|
||||
data Door = Door
|
||||
{ _drID :: Int
|
||||
@@ -47,12 +50,9 @@ data Door = Door
|
||||
, _drObstructs :: [(Int, Int, PathEdge)]
|
||||
, _drObstacleType :: EdgeObstacle
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
|
||||
makeLenses ''Door
|
||||
deriveJSON defaultOptions ''DoorStatus
|
||||
deriveJSON defaultOptions ''PushSource
|
||||
deriveJSON defaultOptions ''Door
|
||||
$($(derive [d| instance Deriving (Store DoorStatus) |]))
|
||||
$($(derive [d| instance Deriving (Store PushSource) |]))
|
||||
$($(derive [d| instance Deriving (Store Door) |]))
|
||||
|
||||
Reference in New Issue
Block a user