60 lines
1.7 KiB
Haskell
60 lines
1.7 KiB
Haskell
{-# LANGUAGE DeriveGeneric #-}
|
|
{-# LANGUAGE DeriveAnyClass #-}
|
|
{-# LANGUAGE StrictData #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Dodge.Data.RightButtonOptions where
|
|
|
|
import Control.Lens
|
|
import Data.Aeson
|
|
import Data.Aeson.TH
|
|
import Dodge.Data.Equipment.Misc
|
|
|
|
data RightButtonOptions
|
|
= NoRightButtonOptions
|
|
| EquipOptions
|
|
{ _opEquip :: [EquipPosition]
|
|
, _opSel :: Int
|
|
, _opItemID :: Int
|
|
, _opAllocateEquipment :: AllocateEquipment
|
|
, _opActivateEquipment :: ModifyEquipmentActivation
|
|
}
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data ModifyEquipmentActivation
|
|
= ActivateEquipment {_activateEquipment :: Int}
|
|
| DeactivateEquipment {_deactivateEquipment :: Int}
|
|
| ActivateDeactivateEquipment {_activateEquipment :: Int, _deactivateEquipment :: Int}
|
|
| NoChangeActivateEquipment
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
data AllocateEquipment
|
|
= DoNotMoveEquipment
|
|
| PutOnEquipment
|
|
{ _allocNewPos :: EquipPosition
|
|
}
|
|
| MoveEquipment
|
|
{ _allocNewPos :: EquipPosition
|
|
, _allocOldPos :: EquipPosition
|
|
}
|
|
| SwapEquipment
|
|
{ _allocNewPos :: EquipPosition
|
|
, _allocOldPos :: EquipPosition
|
|
, _allocSwapID :: Int
|
|
}
|
|
| ReplaceEquipment
|
|
{ _allocNewPos :: EquipPosition
|
|
, _allocRemoveID :: Int
|
|
}
|
|
| RemoveEquipment
|
|
{ _allocOldPos :: EquipPosition
|
|
}
|
|
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
|
|
|
makeLenses ''RightButtonOptions
|
|
makeLenses ''AllocateEquipment
|
|
makeLenses ''ModifyEquipmentActivation
|
|
deriveJSON defaultOptions ''ModifyEquipmentActivation
|
|
deriveJSON defaultOptions ''AllocateEquipment
|
|
deriveJSON defaultOptions ''RightButtonOptions
|