Move around ammo source checks

This commit is contained in:
2024-06-22 16:23:34 +01:00
parent 25cecb8ea6
commit c723d1b1e1
25 changed files with 218 additions and 263 deletions
-10
View File
@@ -17,14 +17,6 @@ import Data.Aeson.TH
import Dodge.Data.Item.Use.Consumption.Ammo
import Dodge.Data.Item.Use.Consumption.LoadAction
data HeldConsumption
= LoadableAmmo
{ _laAmmoType :: AmmoType
, _laSourceType :: AmmoSourceType
}
| NoConsumption
deriving (Eq, Show, Read) --Generic, Flat)
data ReloadStatus = ReloadStatus
{ _iaMax :: Int
, _iaLoaded :: Int
@@ -54,11 +46,9 @@ newtype ItAmount = ItAmount {_getItAmount :: Int}
-- deriving stock (Generic)
-- deriving anyclass (Flat)
makeLenses ''HeldConsumption
makeLenses ''LeftConsumption
makeLenses ''ItAmount
makeLenses ''ReloadStatus
deriveJSON defaultOptions ''ReloadStatus
deriveJSON defaultOptions ''HeldConsumption
deriveJSON defaultOptions ''LeftConsumption
deriveJSON defaultOptions ''ItAmount
+2 -16
View File
@@ -34,25 +34,12 @@ data ProjectileUpdate
| PJRemoteShellCollisionCheck
deriving (Show, Eq, Ord, Read) --Generic, Flat)
data AmmoSourceType
= BulletSource
| ChargeSource
| ChemfuelSource
| BombSource
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data AmmoType
= ProjectileAmmo
| SmallBulletAmmo
| LargeBulletAmmo
| BulletAmmo
| ElectricalAmmo
| DroneAmmo
| GasAmmo
{ _amCreateGas :: GasCreate
}
| ForceFieldAmmo
{ _amForceFieldType :: ForceFieldType
}
| GenericAmmo
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data ForceFieldType = DefaultForceField
@@ -69,4 +56,3 @@ deriveJSON defaultOptions ''ProjectileUpdate
deriveJSON defaultOptions ''GasCreate
deriveJSON defaultOptions ''ForceFieldType
deriveJSON defaultOptions ''AmmoType
deriveJSON defaultOptions ''AmmoSourceType