Skip to content

class : class

function classpp.class(className: string): (classData: classData) -> class

Creates a new class with the given classData table.

Default Syntax

local Class = class "Class" {
    constructor = function(self)
        ...
    end,
    destructor = function(self)
        ...
    end,
    Public = {
        ...
    },
    Private = {
        ...
    },
    Protected = {
        ...
    },
    Friend = {
        ...
    }
}

Without Syntax Sugar

local Class = class("Class")({
    constructor = function(self)
        ...
    end,
    destructor = function(self)
        ...
    end,
    Public = {
        ...
    },
    Private = {
        ...
    },
    Protected = {
        ...
    },
    Friend = {
        ...
    }
})

Parameters

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

Returns

class