NikkoTC
Member
What is it?
GML-Classes is a script that provides some OOP functionality that allows you to define classes, their constructor and destructor, and call parent methods in overridden methods.
Why does it exist?
The main reason is convenience, in particular the convenience of calling parent methods.
When writing code, it may be necessary to implement more complex structures, with several levels of method inheritance.
But structures, due to the lack of an easy way to call the parent method, complicate the task.
To fix that, a special script called GML-Classes was created.
It is based on structs, but makes them more class-like in use.
Thanks to GML-Classes you can do this:
GML-Classes provides the following features:
Highly recommended to check out the documentation.
Links:
GML-Classes is a script that provides some OOP functionality that allows you to define classes, their constructor and destructor, and call parent methods in overridden methods.
Why does it exist?
The main reason is convenience, in particular the convenience of calling parent methods.
When writing code, it may be necessary to implement more complex structures, with several levels of method inheritance.
But structures, due to the lack of an easy way to call the parent method, complicate the task.
To fix that, a special script called GML-Classes was created.
It is based on structs, but makes them more class-like in use.
Thanks to GML-Classes you can do this:
GML-Classes provides the following features:
- Constructor
The constructor initializes the object (class instance) at the time of its creation.
Here you can initialize data, reserve memory, resources, assign refs, etc.
- Destructor
The destructor is executed when the object is destroyed.
Thanks to it, you can deinitialize the object as you need.
For example, break refs, free memory, resources, etc.
- Calling parent method
The ability to call the parent methods allows you to get rid of duplication of the parent code in the overridden methods, which reduces the amount of code and, as a result, makes the code more maintainable and easier to read.
Highly recommended to check out the documentation.
Links:
Last edited: