mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2024-12-30 23:17:53 +02:00
51 lines
835 B
Lua
51 lines
835 B
Lua
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)
|
|
if key and sub_key then
|
|
if this[key] and this[key][sub_key] then
|
|
this[key][sub_key] = nil
|
|
end
|
|
elseif key then
|
|
if this[key] then
|
|
this[key] = nil
|
|
end
|
|
end
|
|
end
|
|
|
|
return Public
|