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
@@ -5,6 +5,8 @@
module Dodge.Data.HUD where
import TH.Derive
import Data.Store
import Data.Binary
import Flat
import LinearHelp ()
@@ -17,7 +19,6 @@ data HUDElement
= DisplayInventory {_subInventory :: SubInventory}
| DisplayCarte
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary HUDElement
data SubInventory
= NoSubInventory
@@ -27,7 +28,7 @@ data SubInventory
| LockedInventory
| DisplayTerminal {_termID :: Int}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary SubInventory
$($(derive [d| instance Deriving (Store SubInventory) |]))
data HUD = HUD
{ _hudElement :: HUDElement
@@ -36,7 +37,7 @@ data HUD = HUD
, _carteRot :: Float
}
deriving (Eq, Ord, Show, Read, Generic, Flat)
instance Binary HUD
$($(derive [d| instance Deriving (Store HUD ) |]))
makeLenses ''HUD
makeLenses ''HUDElement
@@ -44,3 +45,4 @@ makeLenses ''SubInventory
deriveJSON defaultOptions ''HUDElement
deriveJSON defaultOptions ''SubInventory
deriveJSON defaultOptions ''HUD
$($(derive [d| instance Deriving (Store HUDElement) |]))