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
+8 -4
View File
@@ -5,6 +5,8 @@
module Dodge.Data.Item.Effect where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import Control.Lens
@@ -19,7 +21,6 @@ data ItEffect = ItEffect
, _ieOnStash :: ItInvEffect
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary ItEffect
data ItInvEffect
= NoInvEffect
@@ -30,18 +31,21 @@ data ItInvEffect
| RemoveShieldWall
| EffectWhileHeld ItInvEffect
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary ItInvEffect
$($(derive [d| instance Deriving (Store ItInvEffect) |]))
data ItFloorEffect = NoFloorEffect
| HackItFloorEffect
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary ItFloorEffect
data ItDropEffect = NoDropEffect
| HackItDropEffect
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary ItDropEffect
makeLenses ''ItEffect
deriveJSON defaultOptions ''ItEffect
deriveJSON defaultOptions ''ItInvEffect
deriveJSON defaultOptions ''ItFloorEffect
deriveJSON defaultOptions ''ItDropEffect
$($(derive [d| instance Deriving (Store ItEffect ) |]))
$($(derive [d| instance Deriving (Store ItDropEffect ) |]))
$($(derive [d| instance Deriving (Store ItFloorEffect ) |]))