Move from store to flat

This commit is contained in:
2022-08-20 17:54:35 +01:00
parent 8571ab9254
commit ff9dbdf068
95 changed files with 793 additions and 748 deletions
+9 -13
View File
@@ -1,3 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -7,6 +9,7 @@ module Dodge.Data.Item.Use.Consumption.Ammo (
module Dodge.Data.Payload,
) where
import Flat
import TH.Derive
import Data.Store
import Control.Lens
@@ -16,10 +19,10 @@ import Dodge.Data.Bullet
import Dodge.Data.Payload
data ProjectileDraw = DrawShell | DrawRemoteShell | DrawDrone | DrawBlankProjectile
deriving (Show, Read, Eq, Ord, Enum, Bounded)
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
data ProjectileCreate = CreateShell | CreateTrackingShell
deriving (Show, Read, Eq, Ord, Enum, Bounded)
deriving (Show, Read, Eq, Ord, Enum, Bounded, Generic, Flat)
data ProjectileUpdate
= PJThrust {_pjuStart :: Int, _pjuEnd :: Int}
@@ -32,7 +35,7 @@ data ProjectileUpdate
| PJDecTimMvVel
| PJShellCollisionCheck
| PJRemoteShellCollisionCheck
deriving (Show, Read, Eq, Ord)
deriving (Show, Read, Eq, Ord, Generic, Flat)
data AmmoType
= ProjectileAmmo
@@ -55,14 +58,13 @@ data AmmoType
{ _amForceFieldType :: ForceFieldType
}
| GenericAmmo
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data ForceFieldType = DefaultForceField
| HackForTemplateForceField
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data GasCreate = CreatePoisonGas | CreateFlame
deriving (Eq, Ord, Show, Enum, Bounded, Read)
deriving (Eq, Ord, Show, Enum, Bounded, Read, Generic, Flat)
makeLenses ''ProjectileUpdate
makeLenses ''AmmoType
@@ -72,9 +74,3 @@ deriveJSON defaultOptions ''ProjectileUpdate
deriveJSON defaultOptions ''AmmoType
deriveJSON defaultOptions ''GasCreate
deriveJSON defaultOptions ''ForceFieldType
$($(derive [d| instance Deriving (Store ProjectileDraw) |]))
$($(derive [d| instance Deriving (Store ProjectileCreate) |]))
$($(derive [d| instance Deriving (Store ProjectileUpdate) |]))
$($(derive [d| instance Deriving (Store AmmoType) |]))
$($(derive [d| instance Deriving (Store GasCreate) |]))
$($(derive [d| instance Deriving (Store ForceFieldType) |]))
@@ -1,8 +1,11 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Item.Use.Consumption.LoadAction where
import Flat
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
@@ -16,15 +19,15 @@ data LoadAction
| LoadInsert {_actionTime :: Int, _actionSound :: SoundID}
| LoadAdd {_actionTime :: Int, _actionSound :: SoundID, _insertMax :: Int}
| LoadPrime {_actionTime :: Int, _actionSound :: SoundID}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data InvSel = InvSel {_iselPos :: Int, _iselAction :: InvSelAction}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data InvSelAction
= NoInvSelAction
| ReloadAction {_actionProgress :: Int, _reloadAction :: LoadAction, _actionHammer :: HammerType}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
makeLenses ''LoadAction
makeLenses ''InvSel
@@ -32,6 +35,3 @@ makeLenses ''InvSelAction
deriveJSON defaultOptions ''LoadAction
deriveJSON defaultOptions ''InvSel
deriveJSON defaultOptions ''InvSelAction
$($(derive [d| instance Deriving (Store LoadAction) |]))
$($(derive [d| instance Deriving (Store InvSel) |]))
$($(derive [d| instance Deriving (Store InvSelAction) |]))