Add Store instances

This commit is contained in:
2022-08-21 12:21:05 +01:00
parent 1ce7d4a72d
commit dd62e30026
92 changed files with 465 additions and 255 deletions
+5 -3
View File
@@ -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