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

ObjDefManager: Set replacement object's handle info after calling set()

Make gamedef optional when constructing an ObjDefManager
Add note about object ownership
This commit is contained in:
kwolekr 2015-05-03 22:05:24 -04:00
parent 5704fb36d2
commit 5b237b4d94
2 changed files with 15 additions and 3 deletions

View file

@ -206,12 +206,15 @@ public:
std::string name;
};
// WARNING: Ownership of ObjDefs is transferred to the ObjDefManager it is
// added/set to. Note that ObjDefs managed by ObjDefManager are NOT refcounted,
// so the same ObjDef instance must not be referenced multiple
class ObjDefManager {
public:
ObjDefManager(IGameDef *gamedef, ObjDefType type);
virtual ~ObjDefManager();
virtual const char *getObjectTitle() const = 0;
virtual const char *getObjectTitle() const { return "ObjDef"; }
virtual void clear();
virtual ObjDef *getByName(const std::string &name) const;