From 0dc1276df57aa16b4f0eaecf54fb5cd8f00115c6 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Sat, 4 Feb 2023 23:03:19 +0000 Subject: many many optimizations and refactorings; introduction of Map to support multiple chunks, modify worldgen and client drawing to support multiple chunks --- common/class.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/class.lua') diff --git a/common/class.lua b/common/class.lua index 37cf7bd..f5cd46e 100644 --- a/common/class.lua +++ b/common/class.lua @@ -1,3 +1,9 @@ +-- currently a class is a table T with T.__index = T +-- then to make an instance of this class, we do setmetatable(instance,T) +-- this should be fine for anything we wish to do. it is possible we will eventually +-- split this into two separate tables though, perhaps? i don't see why we would ever +-- do this though. + local function class() local T = {} T.__index = T @@ -13,6 +19,7 @@ local function extend(Base) end end setmetatable(T,{__index=Base}) + return T end return setmetatable({ -- cgit v1.2.3