Refactor, try to limit dependencies

This commit is contained in:
2022-07-28 00:59:56 +01:00
parent 8aa5c17ab9
commit 160560af5f
418 changed files with 15104 additions and 13342 deletions
+7 -20
View File
@@ -1,4 +1,3 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
@@ -6,18 +5,13 @@ module Dodge.Data.HUD where
import Control.Lens
import Data.Aeson
import GHC.Generics
import Data.Aeson.TH
import Geometry.Data
data HUDElement
= DisplayInventory {_subInventory :: SubInventory}
| DisplayCarte
deriving (Eq, Ord, Show, Read, Generic)
instance ToJSON HUDElement where
toEncoding = genericToEncoding defaultOptions
instance FromJSON HUDElement
deriving (Eq, Ord, Show, Read)
data SubInventory
= NoSubInventory
@@ -26,12 +20,7 @@ data SubInventory
| InspectInventory
| LockedInventory
| DisplayTerminal {_termID :: Int}
deriving (Eq, Ord, Show, Read, Generic)
instance ToJSON SubInventory where
toEncoding = genericToEncoding defaultOptions
instance FromJSON SubInventory
deriving (Eq, Ord, Show, Read)
data HUD = HUD
{ _hudElement :: HUDElement
@@ -39,13 +28,11 @@ data HUD = HUD
, _carteZoom :: Float
, _carteRot :: Float
}
deriving (Eq, Ord, Show, Read, Generic)
instance ToJSON HUD where
toEncoding = genericToEncoding defaultOptions
instance FromJSON HUD
deriving (Eq, Ord, Show, Read)
makeLenses ''HUD
makeLenses ''HUDElement
makeLenses ''SubInventory
deriveJSON defaultOptions ''HUDElement
deriveJSON defaultOptions ''SubInventory
deriveJSON defaultOptions ''HUD