-
Notifications
You must be signed in to change notification settings - Fork 3
2. Class declaration
Declare your class using the Keyword:
CLASS("FOO")
where FOO have to be a string.
The declaration must be finish with the Keyword:
ENDCLASS;
You can also extend an already existing class by using the keyworkd
CLASS_EXTENDS("NEWFOO","FOO")
The declaration must be finish with the Keyworkd
ENDCLASS;
To instanciate an object from your classe, you have to call the constructor method through the keyword new. The method require the argument type your declare with the constructor method.
example of instanciation with some parameters
_object = ["new", _PARAMETERS_] call FOO;
or
_object = (NEW, _PARAMETERS_);
example of instanciation without parameters
_object = "new" call FOO;
or
_object = NEW(FOO, nil);
To destroy an object, you have to call the deconstructor method through the keyword delete. The method require that you transmit the object you want to destroy as parameter to the class.
example of deconstructor with FOO.
["delete", _object] call FOO;
or
DELETE(_object);
Example:
CLASS("OO_FOO")
PUBLIC FUNCTION("","constructor") {};
PUBLIC FUNCTION("","deconstructor") {};
ENDCLASS;