Add Store instances
This commit is contained in:
@@ -11,6 +11,8 @@ module Dodge.Data.Item.Use.Consumption (
|
||||
module Dodge.Data.Item.Use.Consumption.LoadAction,
|
||||
) where
|
||||
|
||||
import TH.Derive
|
||||
import Data.Store
|
||||
import Data.Binary
|
||||
import Flat
|
||||
import Control.Lens
|
||||
@@ -30,7 +32,7 @@ data HeldConsumption
|
||||
}
|
||||
| NoConsumption
|
||||
deriving (Eq, Show, Read, Generic, Flat)
|
||||
instance Binary HeldConsumption
|
||||
$($(derive [d| instance Deriving (Store HeldConsumption) |]))
|
||||
|
||||
data LeftConsumption
|
||||
= AutoRecharging
|
||||
@@ -44,14 +46,14 @@ data LeftConsumption
|
||||
, _wpCharge :: Int
|
||||
}
|
||||
deriving (Eq, Show, Read, Generic, Flat)
|
||||
instance Binary LeftConsumption
|
||||
$($(derive [d| instance Deriving (Store LeftConsumption) |]))
|
||||
|
||||
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)
|
||||
instance Binary ItAmount
|
||||
$($(derive [d| instance Deriving (Store ItAmount) |]))
|
||||
|
||||
makeLenses ''HeldConsumption
|
||||
makeLenses ''LeftConsumption
|
||||
|
||||
Reference in New Issue
Block a user