/
d.vision
/
division_engine_cpp
Обзор
Документация
Войти
/
d.vision
/
division_engine_cpp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
resources/scripts/hierarchy.lua
36 строк
633 B
den163
Added scrollable widget. Improved error handling
30 ноя 2024, 23:46
30 ноя 2024, 23:46
5e455e6
Код
Авторство
О чём код?
local hierarchy = {} ---@class hierarchy.class local class = {} ---@param name string? function class:inherit(name) local type = {} setmetatable(type, type) type.__index = self type.__name = name type.base_type = self type.self_type = type return type end ---@generic T: hierarchy.class ---@param self T ---@param object table? ---@return T function class.new(self, object) object = object or {} object = setmetatable(object, object) object.__index = self return object end ---@param name string function hierarchy.new_type(name) return class:inherit(name) end return hierarchy