Skip to content

Class

A class object created from the class() function. Contains all of the members given from the classData.

Summary

Properties

 Name : string

 An unique identifier of the class.


 Inherits : Table
Read Only

 A table that contains classes that the class inherits from.


 Friends : Table
Read Only

 A table that contains functions or classes that can access Private and Protected members of the class.


 Statics : Table
Read Only

 A table that contains the static members of the class. These members can only be called through the class object.

Methods

 new (...) : any

 Returns a new object that contains all of the members given from the class.


 extends (className: string) : (classData: classData) : class

 Creates a new class that inherits the class it's been created from. Contains all Public and Protected members of that base class.


 overload (accessSpecifier: string, name: string, functionTable: {(...any) -> (any)}) : void

 Creates an overloaded function with the given access specifier, name and the function table, and saves it to the class's classData.


 static (accessSpecifier: string, name: string, property: any) : void

 Creates a new static class member that can only be accessable through the class object.

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

Table

Read Only

This table contains all the classes that the class is inheriting from. Currently, multiple class inheritance is not supported, so a class can only inherit from one class, but it may be different in the future.

Friends

Table

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

Table

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

any

Creates and returns a new object that contains all of the members given from the class.

Returns

object

extends

class

Creates and returns a new class that inherits the class it's been created from. Contains all the Public and Protected members of that base class.

Parameters

className: string The class name for the new class.
classData: Table The classData table that contains the data about the new class.

Returns

class

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: Table 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. Can be accessed through indexing the class like class.memberName.property (or class.memberName.p)

Returns

void