Refactor, try to limit dependencies
This commit is contained in:
+7
-20
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user