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:
@@ -206,12 +206,15 @@ class ObjDef {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user