mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Start TEngine3.0
Start TEngine3.0
This commit is contained in:
30
Luban/Luban.ClientServer/Templates/common/lua/base.tpl
Normal file
30
Luban/Luban.ClientServer/Templates/common/lua/base.tpl
Normal file
@@ -0,0 +1,30 @@
|
||||
{{
|
||||
enums = x.enums
|
||||
beans = x.beans
|
||||
tables = x.tables
|
||||
}}
|
||||
local setmetatable = setmetatable
|
||||
local pairs = pairs
|
||||
local ipairs = ipairs
|
||||
local tinsert = table.insert
|
||||
|
||||
local function SimpleClass()
|
||||
local class = {}
|
||||
class.__index = class
|
||||
class.New = function(...)
|
||||
local ctor = class.ctor
|
||||
local o = ctor and ctor(...) or {}
|
||||
setmetatable(o, class)
|
||||
return o
|
||||
end
|
||||
return class
|
||||
end
|
||||
|
||||
|
||||
local function get_map_size(m)
|
||||
local n = 0
|
||||
for _ in pairs(m) do
|
||||
n = n + 1
|
||||
end
|
||||
return n
|
||||
end
|
Reference in New Issue
Block a user