Add Store instances
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
module Dodge.Data.Item.Params where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Color
|
||||
@@ -71,15 +73,12 @@ data ItemParams
|
||||
| ParamMID {_paramMID :: Maybe Int}
|
||||
| BoostPropIX {_boostPropIX :: Maybe Int}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary ItemParams
|
||||
|
||||
data ShrinkGunStatus = FullSize | Shrunk
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary ShrinkGunStatus
|
||||
|
||||
data PreviousArcEffect = NoPreviousArcEffect | PerturbTillBreakPreviousArc
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary PreviousArcEffect
|
||||
|
||||
data GunBarrels
|
||||
= MultiBarrel
|
||||
@@ -93,7 +92,6 @@ data GunBarrels
|
||||
}
|
||||
| SingleBarrel {_brlInaccuracy :: Float}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary GunBarrels
|
||||
|
||||
data Nozzle = Nozzle
|
||||
{ _nzPressure :: Float
|
||||
@@ -104,14 +102,12 @@ data Nozzle = Nozzle
|
||||
, _nzLength :: Float
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary Nozzle
|
||||
|
||||
data BarrelSpread
|
||||
= AlignedBarrels
|
||||
| SpreadBarrels {_spreadAngle :: Float}
|
||||
| RotatingBarrels {_rotatingBarrelInaccuracy :: Float}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary BarrelSpread
|
||||
|
||||
makeLenses ''BarrelSpread
|
||||
makeLenses ''ItemParams
|
||||
@@ -123,3 +119,9 @@ deriveJSON defaultOptions ''PreviousArcEffect
|
||||
deriveJSON defaultOptions ''GunBarrels
|
||||
deriveJSON defaultOptions ''Nozzle
|
||||
deriveJSON defaultOptions ''BarrelSpread
|
||||
$($(derive [d| instance Deriving (Store PreviousArcEffect ) |]))
|
||||
$($(derive [d| instance Deriving (Store GunBarrels) |]))
|
||||
$($(derive [d| instance Deriving (Store Nozzle ) |]))
|
||||
$($(derive [d| instance Deriving (Store BarrelSpread) |]))
|
||||
$($(derive [d| instance Deriving (Store ItemParams) |]))
|
||||
$($(derive [d| instance Deriving (Store ShrinkGunStatus ) |]))
|
||||
|
||||
Reference in New Issue
Block a user