Add Store instances
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
module Dodge.Data.Machine.Sensor where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import LinearHelp ()
|
||||
@@ -31,21 +33,21 @@ data Sensor
|
||||
, _sensToggle :: Bool
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Sensor
|
||||
|
||||
data ProximityRequirement
|
||||
= RequireHealth {_proxReqMinHealth :: Int}
|
||||
| RequireEquipment {_proxReqEquipment :: ItemBaseType}
|
||||
| RequireImpossible
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary ProximityRequirement
|
||||
|
||||
data CloseToggle = NotClose | IsClose
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary CloseToggle
|
||||
|
||||
makeLenses ''Sensor
|
||||
makeLenses ''ProximityRequirement
|
||||
deriveJSON defaultOptions ''Sensor
|
||||
deriveJSON defaultOptions ''ProximityRequirement
|
||||
deriveJSON defaultOptions ''CloseToggle
|
||||
$($(derive [d| instance Deriving (Store Sensor) |]))
|
||||
$($(derive [d| instance Deriving (Store ProximityRequirement) |]))
|
||||
$($(derive [d| instance Deriving (Store CloseToggle ) |]))
|
||||
|
||||
Reference in New Issue
Block a user