You know, I plan to go into game development/programming in my future and Graal is about the best amateur platform there is, however it makes it really hard to practice OOP principles sometimes.
Quote:
Originally Posted by Twinny
So can everything other object which allows access to functions which, in turn, provides your precious 'global functions'. So instead of asking for an update which lets you use one less word and a dot, how bout we use what is already there? And before you go all, "but lol global functions already exist!", I'd say there'd be quite a difference between hard coded global functions and gscript ones. Inheritance is more likely. (achieveable by classes!).
|
Wrong, Global functions are separate from the existing object types and not inherited, they're global. They're not involved with inheritance at all. Inherited functions are part of the local object. Thats obvious from reading the Wiki.
Quote:
Originally Posted by Twinny
Request actual features...not just solutions for pure lazyness. Also, don't go running around calling it 'encapsulation'.
|
There is a difference between joining a class and adding another space to the function lookup.
Quote:
Originally Posted by Twinny
Encapsulation is like the process of encapsulating a udp/tcp header/data into an ip packet. For gscript, encapsulation would be more like taking a piece of data and adding it to a self-sufficient container...which undermines the point of 'global functions'. Funilly enough, this could be more readily achieved with classes.
|
"Encapsulation describes the ability of an object to hide its data and methods from the rest of the world - one of the fundamental principles of OOP (Object Oriented Programming)."
Encapsulation means people should be able to use my or anyone else's scripts without knowing how they work, this is the reason I want catchEvent() to work with dynamic function events.
Classes add their functions to the local object, something I don't want, or else I would simply put all the functions I consider "global" and join it to everything, however that would screw up the getfunctions() and such. So instead I divide it up between classes and it becomes disorganized for simple functions such as putnpc3() that don't really fit in a category (and if that happens I just drop it because there is no simple way to make it available everywhere), it also makes it harder on new scripters to the server. I'd rather not be the sole scripter on the server that constructs the main system and if I want my systems to work with others well, encapsulation should be practiced.
Quote:
Originally Posted by Twinny
When requesting something, try explaining what it will achieve and how the current system can't easily achieve the same effect 
|
Like I believe I said, it will make it easier for new scripters or scripters that aren't myself since they don't know how the server ticks, and having all the functions available in one space would make it easier for them since if I reorganize how things work internally they wont get confused. I'd love to be able to present a list to a new scripter or such and tell them thats how you work the server.
Also I like sharing alot of the things I make and global functions would allow something to interface with scripts on another server easily.
Its like standardization, many servers have different ways of organizing their scripts that are good or bad and having custom globals allows different things to work together easier by providing a common space for them to interact.
Its irritating really, I ask for a
simple single addition to the function look up and nobody can actually give a good reason why it
shouldn't be included and actually
explain it at the same time.