mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
move session library implementation to a separate module
This commit is contained in:
parent
4615a425e2
commit
c9f9838747
2 changed files with 18 additions and 17 deletions
17
res/modules/internal/session.lua
Normal file
17
res/modules/internal/session.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
local entries = {}
|
||||||
|
local this = {}
|
||||||
|
|
||||||
|
function this.get_entry(name)
|
||||||
|
local entry = entries[name]
|
||||||
|
if entry == nil then
|
||||||
|
entry = {}
|
||||||
|
entries[name] = entry
|
||||||
|
end
|
||||||
|
return entry
|
||||||
|
end
|
||||||
|
|
||||||
|
function this.reset_entry(name)
|
||||||
|
entries[name] = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
return this
|
||||||
|
|
@ -345,23 +345,7 @@ function gui.template(name, params)
|
||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
session = {
|
session = require "core:internal/session"
|
||||||
entries={}
|
|
||||||
}
|
|
||||||
|
|
||||||
function session.get_entry(name)
|
|
||||||
local entry = session.entries[name]
|
|
||||||
if entry == nil then
|
|
||||||
entry = {}
|
|
||||||
session.entries[name] = entry
|
|
||||||
end
|
|
||||||
return entry
|
|
||||||
end
|
|
||||||
|
|
||||||
function session.reset_entry(name)
|
|
||||||
session.entries[name] = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
stdcomp = require "core:internal/stdcomp"
|
stdcomp = require "core:internal/stdcomp"
|
||||||
entities.get = stdcomp.get_Entity
|
entities.get = stdcomp.get_Entity
|
||||||
entities.get_all = function(uids)
|
entities.get_all = function(uids)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue