zscript-doc/api/base/Object.md

50 lines
1.0 KiB
Markdown
Raw Normal View History

2018-12-29 16:05:19 -08:00
# Object
The base class of all `class` types.
```
class Object
{
2019-08-14 01:31:50 -07:00
bool bDestroyed;
2018-12-29 16:05:19 -08:00
class GetClass();
string GetClassName();
class GetParentClass();
virtualscope void Destroy();
virtual virtualscope void OnDestroy();
}
```
2019-08-14 01:31:50 -07:00
- `bDestroyed`
2018-12-29 16:05:19 -08:00
This object wants to be destroyed but has not yet been garbage collected.
- `GetClass`
Returns the class type of this object.
- `GetClassName`
Returns a string representation of the class type of this object.
- `GetParentClass`
Returns the class type of this object's parent class.
- `Destroy`
Destroys this object. Do not use the object after calling this. References
to it will be invalidated.
2018-12-29 16:05:19 -08:00
- `OnDestroy`
Called just before the object is collected by the garbage collector. **Not
deterministic** unless the object is linked into the thinker list, in which
case it is destroyed earlier in a deterministic setting. Not all `Thinker`s
are linked into this list, so be careful when overriding this. Any `Actor`
will generally be safe.
2018-12-29 16:05:19 -08:00
<!-- EOF -->