Work on inventory management

This commit is contained in:
2023-02-16 16:12:03 +00:00
parent ff5fa6321a
commit 934dd64704
30 changed files with 129 additions and 111 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ data Creature = Creature
, _crHP :: Int
, _crMaxHP :: Int
, _crInv :: IM.IntMap Item
, _crInvSel :: InvSel
, _crManipulation :: Manipulation
, _crInvCapacity :: Int
, _crInvLock :: Bool
, _crInvEquipped :: IM.IntMap EquipPosition
@@ -98,7 +98,7 @@ data Intention = Intention
--deriving (Eq, Show, Read) --Generic, Flat)
crSel :: Creature -> ManipulatedObject
crSel = _isel . _crInvSel
crSel = _isel . _crManipulation
makeLenses ''Creature
makeLenses ''CreatureTargeting
@@ -17,9 +17,9 @@ data LoadAction
| LoadPrime {_actionTime :: Int, _actionSound :: SoundID}
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data InvSel -- should be ManipulatedObject?
data Manipulation -- should be ManipulatedObject?
-- = InvSel {_isel :: SelPos}
= InvSel {_isel :: ManipulatedObject}
= Manipulator {_isel :: ManipulatedObject}
| Brute
deriving (Eq, Ord, Show, Read) --Generic, Flat)
@@ -42,11 +42,11 @@ data LeftInvSel = LeftInvSel
makeLenses ''LoadAction
makeLenses ''ManipulatedObject
makeLenses ''InvSel
makeLenses ''Manipulation
makeLenses ''LeftInvSel
makeLenses ''InvSelAction
deriveJSON defaultOptions ''LoadAction
deriveJSON defaultOptions ''InvSelAction
deriveJSON defaultOptions ''ManipulatedObject
deriveJSON defaultOptions ''InvSel
deriveJSON defaultOptions ''Manipulation
deriveJSON defaultOptions ''LeftInvSel