Flatten values in creature manipulation data types

This commit is contained in:
2024-09-24 21:50:21 +01:00
parent fe00af0e73
commit 25cec10313
24 changed files with 69 additions and 86 deletions
@@ -19,36 +19,18 @@ data Manipulation -- should be ManipulatedObject?
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data ManipulatedObject
= InInventory {_inInventory :: InventoryManipulation}
| SelNothing
| InNearby {_inNearby :: NearbyManipulation}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data NearbyManipulation
= SortNearby
| SelCloseObject {_ispCloseObject :: Int}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data InventoryManipulation
= SortInventory
| SelectedItem
{ _imSelectedItem :: Int
, _imRootItem :: Int
, _imAttachedItems :: IS.IntSet
}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data InvSelAction
= NoInvSelAction
deriving (Eq, Ord, Show, Read) --Generic, Flat)
}
| SelNothing
| SortNearby
| SelCloseObject {_ispCloseObject :: Int}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
makeLenses ''ManipulatedObject
makeLenses ''Manipulation
makeLenses ''InventoryManipulation
makeLenses ''NearbyManipulation
makeLenses ''InvSelAction
deriveJSON defaultOptions ''InvSelAction
deriveJSON defaultOptions ''InventoryManipulation
deriveJSON defaultOptions ''NearbyManipulation
deriveJSON defaultOptions ''ManipulatedObject
deriveJSON defaultOptions ''Manipulation