mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
lua: inventory library
This commit is contained in:
parent
617017d979
commit
e16f7567b1
14 changed files with 257 additions and 44 deletions
|
|
@ -14,10 +14,10 @@ class ContentLUT;
|
|||
class ContentIndices;
|
||||
|
||||
class Inventory : Serializable {
|
||||
uint id;
|
||||
int64_t id;
|
||||
std::vector<ItemStack> slots;
|
||||
public:
|
||||
Inventory(uint id, size_t size);
|
||||
Inventory(int64_t id, size_t size);
|
||||
|
||||
ItemStack& getSlot(size_t index);
|
||||
size_t findEmptySlot(size_t begin=0, size_t end=-1) const;
|
||||
|
|
@ -40,10 +40,14 @@ public:
|
|||
|
||||
static void convert(dynamic::Map* data, const ContentLUT* lut);
|
||||
|
||||
inline uint getId() const {
|
||||
inline int64_t getId() const {
|
||||
return id;
|
||||
}
|
||||
|
||||
inline bool isVirtual() const {
|
||||
return id < 0;
|
||||
}
|
||||
|
||||
static const size_t npos;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue