Move from store to flat

This commit is contained in:
2022-08-20 17:54:35 +01:00
parent 8571ab9254
commit ff9dbdf068
95 changed files with 793 additions and 748 deletions
+6 -6
View File
@@ -1,3 +1,5 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -8,6 +10,7 @@ module Dodge.Data.Item.Use.Consumption (
module Dodge.Data.Item.Use.Consumption.LoadAction,
) where
import Flat
import TH.Derive
import Data.Store
import Control.Lens
@@ -26,7 +29,7 @@ data HeldConsumption
, _laProgress :: Maybe [LoadAction]
}
| NoConsumption
deriving (Eq, Show, Read)
deriving (Eq, Show, Read, Generic, Flat)
data LeftConsumption
= AutoRecharging
@@ -39,10 +42,10 @@ data LeftConsumption
{ _wpMaxCharge :: Int
, _wpCharge :: Int
}
deriving (Eq, Show, Read)
deriving (Eq, Show, Read, Generic, Flat)
newtype ItAmount = ItAmount {_getItAmount :: Int}
deriving (Eq, Ord, Read, Show, Num, Real, Enum, Integral)
deriving (Eq, Ord, Read, Show, Num, Real, Enum, Integral, Generic, Flat)
makeLenses ''HeldConsumption
makeLenses ''LeftConsumption
@@ -50,6 +53,3 @@ makeLenses ''ItAmount
deriveJSON defaultOptions ''HeldConsumption
deriveJSON defaultOptions ''LeftConsumption
deriveJSON defaultOptions ''ItAmount
$($(derive [d| instance Deriving (Store HeldConsumption) |]))
$($(derive [d| instance Deriving (Store LeftConsumption) |]))
$($(derive [d| instance Deriving (Store ItAmount) |]))