Add Binary instances
This commit is contained in:
@@ -9,6 +9,7 @@ module Dodge.Data.Item.Use.Consumption.Ammo (
|
||||
module Dodge.Data.Payload,
|
||||
) where
|
||||
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
@@ -18,9 +19,11 @@ 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}
|
||||
@@ -34,6 +37,7 @@ data ProjectileUpdate
|
||||
| PJShellCollisionCheck
|
||||
| PJRemoteShellCollisionCheck
|
||||
deriving (Show, Read, Eq, Ord, Generic, Flat)
|
||||
instance Binary ProjectileUpdate
|
||||
|
||||
data AmmoType
|
||||
= ProjectileAmmo
|
||||
@@ -57,12 +61,15 @@ data AmmoType
|
||||
}
|
||||
| GenericAmmo
|
||||
deriving (Eq, Ord, Show, Read, Generic, Flat)
|
||||
instance Binary AmmoType
|
||||
|
||||
data ForceFieldType = DefaultForceField
|
||||
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
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction where
|
||||
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
@@ -18,14 +19,17 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user