14#define OBJDEF_INVALID_INDEX ((u32)(-1))
15#define OBJDEF_INVALID_HANDLE 0
16#define OBJDEF_HANDLE_SALT 0x00585e6fu
17#define OBJDEF_MAX_ITEMS (1 << 18)
18#define OBJDEF_UID_MASK ((1 << 7) - 1)
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:540
void cloneTo(ObjDefManager *mgr) const
Definition objdef.cpp:181
const NodeDefManager * getNodeDef() const
Definition objdef.h:84
virtual ObjDefHandle add(ObjDef *obj)
Definition objdef.cpp:24
virtual ~ObjDefManager()
Definition objdef.cpp:17
static bool decodeHandle(ObjDefHandle handle, u32 *index, ObjDefType *type, u32 *uid)
Definition objdef.cpp:155
ObjDefManager()
Definition objdef.h:92
u32 validateHandle(ObjDefHandle handle) const
Definition objdef.cpp:124
virtual const char * getObjectTitle() const
Definition objdef.h:64
size_t getNumObjects() const
Definition objdef.h:82
static ObjDefHandle createHandle(u32 index, ObjDefType type, u32 uid)
Definition objdef.cpp:141
virtual ObjDef * getRaw(u32 index) const
Definition objdef.cpp:89
virtual void clear()
Definition objdef.cpp:115
virtual ObjDef * get(ObjDefHandle handle) const
Definition objdef.cpp:40
const NodeDefManager * m_ndef
Definition objdef.h:96
DISABLE_CLASS_COPY(ObjDefManager)
ObjDefType m_objtype
Definition objdef.h:98
virtual ObjDef * set(ObjDefHandle handle, ObjDef *obj)
Definition objdef.cpp:47
std::vector< ObjDef * > m_objects
Definition objdef.h:97
ObjDefType getType() const
Definition objdef.h:83
virtual u32 addRaw(ObjDef *obj)
Definition objdef.cpp:63
virtual ObjDef * setRaw(u32 index, ObjDef *obj)
Definition objdef.cpp:95
virtual ObjDef * getByName(const std::string &name) const
Definition objdef.cpp:103
u32 uid
Definition objdef.h:40
void cloneTo(ObjDef *def) const
Definition objdef.cpp:173
virtual ~ObjDef()=default
virtual ObjDef * clone() const =0
u32 index
Definition objdef.h:39
ObjDefHandle handle
Definition objdef.h:41
std::string name
Definition objdef.h:42
u32 ObjDefHandle
Definition objdef.h:20
ObjDefType
Definition objdef.h:22
@ OBJDEF_SCHEMATIC
Definition objdef.h:27
@ OBJDEF_BIOME
Definition objdef.h:24
@ OBJDEF_DECORATION
Definition objdef.h:26
@ OBJDEF_GENERIC
Definition objdef.h:23
@ OBJDEF_ORE
Definition objdef.h:25