2022-03-15 19:59:38 +01:00
|
|
|
local Global = require 'utils.global'
|
|
|
|
|
|
|
|
local this = {
|
|
|
|
settings = {
|
|
|
|
chunk_load_tick = false,
|
|
|
|
chunks_charted = {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Global.register(
|
|
|
|
this,
|
|
|
|
function(tbl)
|
|
|
|
this = tbl
|
|
|
|
end
|
|
|
|
)
|
|
|
|
|
|
|
|
local Public = {}
|
|
|
|
|
|
|
|
function Public.get(key)
|
|
|
|
if key then
|
|
|
|
return this[key]
|
|
|
|
else
|
|
|
|
return this
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Public.set(key, value)
|
|
|
|
if key and (value or value == false) then
|
|
|
|
this[key] = value
|
|
|
|
return this[key]
|
|
|
|
elseif key then
|
|
|
|
return this[key]
|
|
|
|
else
|
|
|
|
return this
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Public.remove(key, sub_key)
|
2022-03-17 12:23:16 +01:00
|
|
|
if key and sub_key then
|
2022-03-15 19:59:38 +01:00
|
|
|
if this[key] and this[key][sub_key] then
|
|
|
|
this[key][sub_key] = nil
|
2022-03-17 12:23:16 +01:00
|
|
|
end
|
|
|
|
elseif key then
|
|
|
|
if this[key] then
|
2022-03-15 19:59:38 +01:00
|
|
|
this[key] = nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return Public
|