53 lines
1.4 KiB
Haskell
53 lines
1.4 KiB
Haskell
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE DerivingStrategies #-}
|
|
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.Item.Use.Consumption (
|
|
module Dodge.Data.Item.Use.Consumption,
|
|
module Dodge.Data.Item.Use.Consumption.Ammo,
|
|
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
|
) where
|
|
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Dodge.Data.Item.Use.Consumption.Ammo
|
|
import Dodge.Data.Item.Use.Consumption.LoadAction
|
|
|
|
data ReloadStatus = ReloadStatus
|
|
{ _iaMax :: Int
|
|
, _iaLoaded :: Int
|
|
-- , _iaPrimed :: Bool
|
|
}
|
|
deriving (Eq, Show, Read) --Generic, Flat)
|
|
|
|
data LeftConsumption
|
|
= AutoRecharging
|
|
{ _arLoaded :: Int
|
|
, _arMax :: Int
|
|
, _arTime :: Int
|
|
, _arProgress :: Int
|
|
}
|
|
| ChargeableAmmo
|
|
{ _wpMaxCharge :: Int
|
|
, _wpCharge :: Int
|
|
}
|
|
deriving (Eq, Show, Read) --Generic, Flat)
|
|
|
|
newtype ItAmount = ItAmount {_getItAmount :: Int}
|
|
-- deriving (Eq, Ord, Read Show, Num, Real,) --Generic, Flat)
|
|
deriving newtype (Eq, Ord, Read, Show, Num, Real, Enum, Integral)
|
|
|
|
-- deriving stock (Generic)
|
|
-- deriving anyclass (Flat)
|
|
|
|
makeLenses ''LeftConsumption
|
|
makeLenses ''ItAmount
|
|
makeLenses ''ReloadStatus
|
|
deriveJSON defaultOptions ''ReloadStatus
|
|
deriveJSON defaultOptions ''LeftConsumption
|
|
deriveJSON defaultOptions ''ItAmount
|