Skip to content

Instantly share code, notes, and snippets.

View AlphaTechNinja's full-sized avatar

AlphaTechNinja

View GitHub Profile
@AlphaTechNinja
AlphaTechNinja / classes.lua
Created April 12, 2024 21:35
A refined version of my class library (now supports multi class inheritance, search tree, and loading) WARNING: this is written for cc: tweaked (to make it compatible with other engines you will have to change the “fs library to match the ones of your program”)
--refined class library
local classes = {}
classes.__index = classes
classes.path = package.path
classes._tree = {}
classes.loaded = {}
local weakTab = {__mode = "k"}
@AlphaTechNinja
AlphaTechNinja / class.lua
Last active March 18, 2024 17:58
A simple class library for Lua
--classes in lua
local classes = {}
function classes.create(name, inherit)
local class = setmetatable({}, inherit or classes)
class.__name = name
class.__index = class
return class
end
--meta
setmetatable(