summaryrefslogtreecommitdiffstats
path: root/source/ItemGrid.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/ItemGrid.h')
-rw-r--r--source/ItemGrid.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/ItemGrid.h b/source/ItemGrid.h
index 7a2a828b1..de8be059a 100644
--- a/source/ItemGrid.h
+++ b/source/ItemGrid.h
@@ -42,15 +42,18 @@ public:
int GetSlotNum(int a_X, int a_Y) const;
// tolua_end
+
/// Converts slot number into XY coords; sets coords to -1 on invalid slot number. Exported in ManualBindings.cpp
void GetSlotCoords(int a_SlotNum, int & a_X, int & a_Y) const;
+
+ cItem & GetSlot(int a_X, int a_Y); // TODO: This will be removed!
+ cItem & GetSlot(int a_SlotNum); // TODO: This will be removed!
+
// tolua_begin
// Retrieve slots by coords or slot number; Logs warning and returns the first slot on invalid coords / slotnum
const cItem & GetSlot(int a_X, int a_Y) const;
- cItem & GetSlot(int a_X, int a_Y);
const cItem & GetSlot(int a_SlotNum) const;
- cItem & GetSlot(int a_SlotNum);
// Set slot by coords or slot number; Logs warning and doesn't set on invalid coords / slotnum
void SetSlot(int a_X, int a_Y, const cItem & a_Item);
@@ -89,6 +92,12 @@ public:
*/
int ChangeSlotCount(int a_SlotNum, int a_AddToCount);
+ /** Adds (or subtracts, if a_AddToCount is negative) to the count of items in the specified slot.
+ If the slot is empty, ignores the call.
+ Returns the new count.
+ */
+ int ChangeSlotCount(int a_X, int a_Y, int a_AddToCount);
+
/// Returns the number of items of type a_Item that are stored
int HowManyItems(const cItem & a_Item);
@@ -110,6 +119,9 @@ public:
/// Adds the specified damage to the specified item; returns true if the item broke (but the item is left intact)
bool DamageItem(int a_SlotNum, short a_Amount);
+ /// Adds the specified damage to the specified item; returns true if the item broke (but the item is left intact)
+ bool DamageItem(int a_X, int a_Y, short a_Amount);
+
// tolua_end