mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
session = require "core:internal/session"
|
||||
stdcomp = require "core:internal/stdcomp"
|
||||
entities.get = stdcomp.get_Entity
|
||||
entities.get_all = function(uids)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue