Add Store instances
This commit is contained in:
@@ -11,6 +11,8 @@ module Dodge.Data.Item.Use.Consumption (
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
@@ -30,7 +32,7 @@ data HeldConsumption
|
||||
}
|
||||
| NoConsumption
|
||||
deriving (Eq, Show, Read, Generic, Flat)
|
||||
instance Binary HeldConsumption
|
||||
$($(derive [d| instance Deriving (Store HeldConsumption) |]))
|
||||
|
||||
data LeftConsumption
|
||||
= AutoRecharging
|
||||
@@ -44,14 +46,14 @@ data LeftConsumption
|
||||
, _wpCharge :: Int
|
||||
}
|
||||
deriving (Eq, Show, Read, Generic, Flat)
|
||||
instance Binary LeftConsumption
|
||||
$($(derive [d| instance Deriving (Store LeftConsumption) |]))
|
||||
|
||||
newtype ItAmount = ItAmount {_getItAmount :: Int}
|
||||
-- deriving (Eq, Ord, Read, Show, Num, Real, Generic, Flat)
|
||||
deriving newtype (Eq, Ord, Read, Show, Num, Real, Enum, Integral)
|
||||
deriving stock (Generic)
|
||||
deriving anyclass (Flat)
|
||||
instance Binary ItAmount
|
||||
$($(derive [d| instance Deriving (Store ItAmount) |]))
|
||||
|
||||
makeLenses ''HeldConsumption
|
||||
makeLenses ''LeftConsumption
|
||||
|
||||
@@ -9,6 +9,8 @@ module Dodge.Data.Item.Use.Consumption.Ammo (
|
||||
module Dodge.Data.Payload,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
@@ -19,11 +21,9 @@ import Dodge.Data.Payload
|
||||
|
||||
data ProjectileDraw = DrawShell | DrawRemoteShell | DrawDrone | DrawBlankProjectile
|
||||
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
||||
instance Binary ProjectileDraw
|
||||
|
||||
data ProjectileCreate = CreateShell | CreateTrackingShell
|
||||
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
|
||||
instance Binary ProjectileCreate
|
||||
|
||||
data ProjectileUpdate
|
||||
= PJThrust {_pjuStart :: Int, _pjuEnd :: Int}
|
||||
@@ -37,7 +37,6 @@ data ProjectileUpdate
|
||||
| PJShellCollisionCheck
|
||||
| PJRemoteShellCollisionCheck
|
||||
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
||||
instance Binary ProjectileUpdate
|
||||
|
||||
data AmmoType
|
||||
= ProjectileAmmo
|
||||
@@ -61,15 +60,13 @@ data AmmoType
|
||||
}
|
||||
| GenericAmmo
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary AmmoType
|
||||
|
||||
data ForceFieldType = DefaultForceField
|
||||
| HackForceFieldType
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary ForceFieldType
|
||||
|
||||
data GasCreate = CreatePoisonGas | CreateFlame
|
||||
deriving (Eq, Ord, Show, Enum, Bounded, Read, Generic, Flat)
|
||||
instance Binary GasCreate
|
||||
|
||||
makeLenses ''ProjectileUpdate
|
||||
makeLenses ''AmmoType
|
||||
@@ -79,3 +76,9 @@ deriveJSON defaultOptions ''ProjectileUpdate
|
||||
deriveJSON defaultOptions ''AmmoType
|
||||
deriveJSON defaultOptions ''GasCreate
|
||||
deriveJSON defaultOptions ''ForceFieldType
|
||||
$($(derive [d| instance Deriving (Store AmmoType) |]))
|
||||
$($(derive [d| instance Deriving (Store ProjectileDraw ) |]))
|
||||
$($(derive [d| instance Deriving (Store ProjectileCreate ) |]))
|
||||
$($(derive [d| instance Deriving (Store ProjectileUpdate) |]))
|
||||
$($(derive [d| instance Deriving (Store ForceFieldType ) |]))
|
||||
$($(derive [d| instance Deriving (Store GasCreate ) |]))
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
@@ -19,17 +21,14 @@ data LoadAction
|
||||
| LoadAdd {_actionTime :: Int, _actionSound :: SoundID, _insertMax :: Int}
|
||||
| LoadPrime {_actionTime :: Int, _actionSound :: SoundID}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary LoadAction
|
||||
|
||||
data InvSel = InvSel {_iselPos :: Int, _iselAction :: InvSelAction}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary InvSel
|
||||
|
||||
data InvSelAction
|
||||
= NoInvSelAction
|
||||
| ReloadAction {_actionProgress :: Int, _reloadAction :: LoadAction, _actionHammer :: HammerType}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary InvSelAction
|
||||
|
||||
makeLenses ''LoadAction
|
||||
makeLenses ''InvSel
|
||||
@@ -37,3 +36,6 @@ makeLenses ''InvSelAction
|
||||
deriveJSON defaultOptions ''LoadAction
|
||||
deriveJSON defaultOptions ''InvSel
|
||||
deriveJSON defaultOptions ''InvSelAction
|
||||
$($(derive [d| instance Deriving (Store LoadAction) |]))
|
||||
$($(derive [d| instance Deriving (Store InvSelAction) |]))
|
||||
$($(derive [d| instance Deriving (Store InvSel ) |]))
|
||||
|
||||
@@ -8,6 +8,8 @@ module Dodge.Data.Item.Use.Equipment (
|
||||
module Dodge.Data.Item.Use.Equipment,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
@@ -25,16 +27,16 @@ data EquipEffect = EquipEffect
|
||||
, _eeViewDist :: Maybe Float
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary EquipEffect
|
||||
|
||||
data EquipParams
|
||||
= NoEquipParams
|
||||
| EquipID {_eparamID :: Int}
|
||||
| EquipCounter {_eparamInt :: Int}
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary EquipParams
|
||||
|
||||
makeLenses ''EquipEffect
|
||||
makeLenses ''EquipParams
|
||||
deriveJSON defaultOptions ''EquipEffect
|
||||
deriveJSON defaultOptions ''EquipParams
|
||||
$($(derive [d| instance Deriving (Store EquipEffect ) |]))
|
||||
$($(derive [d| instance Deriving (Store EquipParams) |]))
|
||||
|
||||
Reference in New Issue
Block a user