Work towards adding external ammo sources
This commit is contained in:
@@ -20,17 +20,26 @@ import Dodge.Data.Item.Use.Consumption.LoadAction
|
||||
data HeldConsumption
|
||||
= LoadableAmmo
|
||||
{ _laAmmoType :: AmmoType
|
||||
, _laMax :: Int
|
||||
, _laLoaded :: Int
|
||||
, _laPrimed :: Bool
|
||||
, _laCycle :: [LoadAction]
|
||||
, _laProgress :: Maybe [LoadAction]
|
||||
, _laSource :: AmmoSource
|
||||
, _laSourceType :: AmmoSourceType
|
||||
}
|
||||
| ChargingAmmo { _caCharge :: Int
|
||||
, _caMax :: Int }
|
||||
| NoConsumption
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data AmmoSource
|
||||
= InternalSource InternalAmmo
|
||||
| ExternalSource { _eaAttachment :: Maybe Int }
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data InternalAmmo = InternalAmmo
|
||||
{ _iaMax :: Int
|
||||
, _iaLoaded :: Int
|
||||
, _iaPrimed :: Bool
|
||||
, _iaCycle :: [LoadAction]
|
||||
, _iaProgress :: Maybe [LoadAction]
|
||||
}
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data LeftConsumption
|
||||
= AutoRecharging
|
||||
{ _arLoaded :: Int
|
||||
@@ -53,6 +62,10 @@ newtype ItAmount = ItAmount {_getItAmount :: Int}
|
||||
makeLenses ''HeldConsumption
|
||||
makeLenses ''LeftConsumption
|
||||
makeLenses ''ItAmount
|
||||
makePrisms ''AmmoSource
|
||||
makeLenses ''InternalAmmo
|
||||
deriveJSON defaultOptions ''InternalAmmo
|
||||
deriveJSON defaultOptions ''AmmoSource
|
||||
deriveJSON defaultOptions ''HeldConsumption
|
||||
deriveJSON defaultOptions ''LeftConsumption
|
||||
deriveJSON defaultOptions ''ItAmount
|
||||
|
||||
Reference in New Issue
Block a user