Refactor, try to limit dependencies
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
@@ -6,8 +5,8 @@ module Dodge.Data.RightButtonOptions where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Equipment.Misc
|
||||
import GHC.Generics
|
||||
|
||||
data RightButtonOptions
|
||||
= NoRightButtonOptions
|
||||
@@ -18,24 +17,14 @@ data RightButtonOptions
|
||||
, _opAllocateEquipment :: AllocateEquipment
|
||||
, _opActivateEquipment :: ActivateEquipment
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON RightButtonOptions where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON RightButtonOptions
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data ActivateEquipment
|
||||
= ActivateEquipment {_activateEquipment :: Int}
|
||||
| DeactivateEquipment {_deactivateEquipment :: Int}
|
||||
| ActivateDeactivateEquipment {_activateEquipment :: Int, _deactivateEquipment :: Int}
|
||||
| NoChangeActivateEquipment
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON ActivateEquipment where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON ActivateEquipment
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data AllocateEquipment
|
||||
= DoNotMoveEquipment
|
||||
@@ -58,13 +47,11 @@ data AllocateEquipment
|
||||
| RemoveEquipment
|
||||
{ _allocOldPos :: EquipPosition
|
||||
}
|
||||
deriving (Eq, Ord, Show, Read, Generic)
|
||||
|
||||
instance ToJSON AllocateEquipment where
|
||||
toEncoding = genericToEncoding defaultOptions
|
||||
|
||||
instance FromJSON AllocateEquipment
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
makeLenses ''RightButtonOptions
|
||||
makeLenses ''AllocateEquipment
|
||||
makeLenses ''ActivateEquipment
|
||||
deriveJSON defaultOptions ''RightButtonOptions
|
||||
deriveJSON defaultOptions ''ActivateEquipment
|
||||
deriveJSON defaultOptions ''AllocateEquipment
|
||||
|
||||
Reference in New Issue
Block a user