#include "debug.h"
#include "itemdef.h"
-struct ToolDiggingProperties;
+struct ToolCapabilities;
struct ItemStack
{
}
// Get tool digging properties, or those of the hand if not a tool
- const ToolDiggingProperties& getToolDiggingProperties(
+ const ToolCapabilities& getToolCapabilities(
IItemDefManager *itemdef) const
{
- ToolDiggingProperties *prop;
- prop = itemdef->get(name).tool_digging_properties;
- if(prop == NULL)
- prop = itemdef->get("").tool_digging_properties;
- assert(prop != NULL);
- return *prop;
+ ToolCapabilities *cap;
+ cap = itemdef->get(name).tool_capabilities;
+ if(cap == NULL)
+ cap = itemdef->get("").tool_capabilities;
+ assert(cap != NULL);
+ return *cap;
}
// Wear out (only tools)
// Similar to takeItem, but keeps the slot intact.
ItemStack peekItem(u32 i, u32 peekcount) const;
+ // Move an item to a different list (or a different stack in the same list)
+ // count is the maximum number of items to move (0 for everything)
+ void moveItem(u32 i, InventoryList *dest, u32 dest_i, u32 count = 0);
+
private:
std::vector<ItemStack> m_items;
u32 m_size;