This commit is contained in:
2022-07-27 12:49:23 +01:00
parent 6554d219dc
commit 8d17ce66e9
106 changed files with 2911 additions and 2678 deletions
+46
View File
@@ -0,0 +1,46 @@
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.Item.Use.Consumption where
import Control.Lens
import Data.Aeson
import Data.Aeson.TH
import Dodge.Data.Ammo
import Dodge.Data.LoadAction
data HeldConsumption
= LoadableAmmo
{ _laAmmoType :: AmmoType
, _laMax :: Int
, _laLoaded :: Int
, _laPrimed :: Bool
, _laCycle :: [LoadAction]
, _laProgress :: Maybe [LoadAction]
}
| NoConsumption
deriving (Eq, Show, Read)
data LeftConsumption
= AutoRecharging
{ _arLoaded :: Int
, _arMax :: Int
, _arTime :: Int
, _arProgress :: Int
}
| ChargeableAmmo
{ _wpMaxCharge :: Int
, _wpCharge :: Int
}
deriving (Eq, Show, Read)
newtype ItAmount = ItAmount {_getItAmount :: Int}
deriving (Eq, Ord, Read, Show, Num, Real, Enum, Integral)
makeLenses ''HeldConsumption
makeLenses ''LeftConsumption
makeLenses ''ItAmount
deriveJSON defaultOptions ''HeldConsumption
deriveJSON defaultOptions ''LeftConsumption
deriveJSON defaultOptions ''ItAmount