From d6d811f97bc921b11da735fda15b07de180b298b Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 5 Apr 2011 10:59:48 +0300 Subject: A more robust format for node metadata --- src/inventory.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/inventory.h') diff --git a/src/inventory.h b/src/inventory.h index 0cbd97abc..d110f92c0 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -72,6 +72,7 @@ public: { m_count = count; } + // This should return something else for stackable items virtual u16 freeSpace() { return 0; @@ -87,6 +88,14 @@ public: m_count -= count; } + /* + Other properties + */ + // Time of cooking + virtual float getCookTime(){return 3.0;} + // Result of cooking + virtual InventoryItem *createCookResult(){return NULL;} + protected: u16 m_count; }; @@ -148,6 +157,10 @@ public: return 0; return QUANTITY_ITEM_MAX_COUNT - m_count; } + /* + Other properties + */ + InventoryItem *createCookResult(); /* Special methods */ @@ -428,6 +441,7 @@ public: u32 getSize(); // Count used slots u32 getUsedSlots(); + u32 getFreeSlots(); // Get pointer to item InventoryItem * getItem(u32 i); -- cgit v1.2.3