1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

A more robust format for node metadata

This commit is contained in:
Perttu Ahola 2011-04-05 10:59:48 +03:00
parent d1d57cf5c3
commit d6d811f97b
3 changed files with 59 additions and 11 deletions

View file

@ -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);