-
Notifications
You must be signed in to change notification settings - Fork 0
Using Classes
Objects can be instantiated by invoking a function corresponding to the class's name. The following Example will instantiate an object of class ObjectWrappper and assign it to _x.
var _instance = ObjectWrapper();
Variables can be accessed and modified using the dot operator
Get object variable
_instance.containedObject
Set object variable
_instance.containedObject = player;
Object methods can be accessed using the dot operator, and invoked similarly to normal functions.
_instance.isNull();
Copying an object will create a shallow copy of the supplied instance. A function named copy_constructor will be called if available.
copy _instance;
In order to prevent memory leaks, objects must be deleted before their references are released. Deletion requires the use of the keyword delete with the right-side of the expression taking the variable containing the object instance.
delete _instance;