Yeah that's what I am doing..Robin wrote:Not what I meant. You could make a class called Object which implements the event system. Then you let all the other classes subclass Object and voilà: one free event system.Trappingnoobs wrote:That's what I'm doing... Inheriting is the same as subclassing; everything from class A is put into class B if class B asks for it.
Code: Select all
Class "GUIElement" {
General_GUI_properties
Event_stuff
}
Class "Checkbox" ({Checkbox properties}, {GUIElement})
And checkbox automatically has "Event_stuff" and "General_GUI_Properties"- The only events inside Checkbox will just be it's own ones that no other elements have.
I don't want to make the tables in the constructor (Assuming you're reffering to the optional load function that is auto-called when the class is instanced) because that's too limiting. The class system is primarily included due to the GUI using it- The person who 'installs' the GUI stuff into their game doesn't necessarily need to make their own classes, and if they did, I can't think why they'd want a class that refferences itself.Robin wrote:Yes, you are.Trappingnoobs wrote:I'm probably wrong.