Class
A class
object created from the class()
function. Contains all of the members given from the classData
.
Summary
Properties
- Name: An unique identifier of the
class
. - Inherits: A table that contains classes that the
class
inherits from. - Friends: A table that contains functions or clases that can access the
Private
and theProtected
members of theclass
. - Statics: A table that contains the static members of the
class
. These members can only be called through theclass
object.
Methods
- new: Returns a new
object
that contains all of the members given from theclass
. - extends: Used to create a new
class
that inherits theclass
it's been created from. (Deprecated) - overload: Creates an overloaded function with the given access specifier, name and the function table, and saves it to the
class
'sclassData
.
Properties
Name : string
This is an unique identifier of the class
. Using the getClass()
function with this property will retrieve the desired class
. Since names are unique, for every class, you have to use a different name.
Inherits
: {class}
Read Only
This table contains all the classes that the class
is inheriting from.
Friends
: {class}
Read Only
This table contains all the functions and the classes that can access all of the Public
and Protected
members of the class
.
Statics
: {[string]: any}
Read Only
This table contains all the members that are static, meaning they only belong to the class
. These members won't replicate to the
objects, and can only be called through the class
object.
Methods
new : object
Creates and returns a new object
that contains all of the members given from the class
.
Returns
extends : void
Used to create and return a new class
that inherits the class
it's been created from.
Deprecated
This method has been deprecated and should not be used for new work.
Instead, use the class
method.
overload : void
Creates an overloaded function with the given parameters, and saves it to the class
's classData
table.
Parameters
accessSpecifier: string
The access specifier of the overloaded function.
name: string
The name of the overloaded function.
functionTable: {(...any) -> (any)}
The function table that contains all the functions with different amount of arguments for the overloaded function.
Returns
void
static : void
Creates a new static member with the given parameters, and saves it to the class
's Statics
table. These members do not replicate to the objects, as they belong to the class
.
Parameters
accessSpecifier: string
The access specifier of the static member.
name: string
The name of the static member.
property: any
The property that will be saved to the static member. This property can then be accessed through indexing the
class
with the member name, such as: class.memberName.property
. (Or class.memberName.p
)
Returns
void