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:
parent
d1d57cf5c3
commit
d6d811f97b
3 changed files with 59 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue