Add Store instances

This commit is contained in:
2022-08-21 12:21:05 +01:00
parent 1ce7d4a72d
commit dd62e30026
92 changed files with 465 additions and 255 deletions
+8 -6
View File
@@ -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 ) |]))