zscript-doc/api/base/Object.md

50 lines
1023 B
Markdown
Raw Permalink Normal View History

2018-12-29 16:05:19 -08:00
# Object
The base class of all `class` types.
```
class Object
{
2019-08-14 03:32:51 -07:00
bool bDestroyed;
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
class GetClass();
string GetClassName();
class GetParentClass();
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
virtualscope void Destroy();
2018-12-29 16:05:19 -08:00
2019-08-14 03:32:51 -07:00
virtual virtualscope void OnDestroy();
2018-12-29 16:05:19 -08:00
}
```
2019-08-14 03:31:41 -07:00
### `bDestroyed`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
This object wants to be destroyed but has not yet been garbage collected.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `GetClass`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Returns the class type of this object.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `GetClassName`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Returns a string representation of the class type of this object.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `GetParentClass`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
Returns the class type of this object's parent class.
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
### `Destroy`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
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
2019-08-14 03:31:41 -07:00
### `OnDestroy`
2018-12-29 16:05:19 -08:00
2019-08-14 03:31:41 -07:00
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 -->