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,8 +1,11 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module Dodge.Data.HUD where
import Flat
import LinearHelp
import Control.Lens
import Data.Aeson
@@ -14,7 +17,7 @@ import Data.Store
data HUDElement
= DisplayInventory {_subInventory :: SubInventory}
| DisplayCarte
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data SubInventory
= NoSubInventory
@@ -23,7 +26,7 @@ data SubInventory
| InspectInventory
| LockedInventory
| DisplayTerminal {_termID :: Int}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
data HUD = HUD
{ _hudElement :: HUDElement
@@ -31,7 +34,7 @@ data HUD = HUD
, _carteZoom :: Float
, _carteRot :: Float
}
deriving (Eq, Ord, Show, Read)
deriving (Eq, Ord, Show, Read, Generic, Flat)
makeLenses ''HUD
makeLenses ''HUDElement
@@ -39,6 +42,3 @@ makeLenses ''SubInventory
deriveJSON defaultOptions ''HUDElement
deriveJSON defaultOptions ''SubInventory
deriveJSON defaultOptions ''HUD
$($(derive [d| instance Deriving (Store HUDElement) |]))
$($(derive [d| instance Deriving (Store SubInventory) |]))
$($(derive [d| instance Deriving (Store HUD) |]))