mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-03-11 14:49:59 +02:00
added global token
This commit is contained in:
parent
197a677559
commit
77d4fc9c4a
20
utils/global_token.lua
Normal file
20
utils/global_token.lua
Normal file
@ -0,0 +1,20 @@
|
||||
local Token
|
||||
|
||||
local tokens = {}
|
||||
|
||||
local counter = 1
|
||||
|
||||
function Token.register(var)
|
||||
local c = counter
|
||||
|
||||
tokens[c] = var
|
||||
counter = c + 1
|
||||
|
||||
return c
|
||||
end
|
||||
|
||||
function Token.get(token_id)
|
||||
return tokens[token_id]
|
||||
end
|
||||
|
||||
return Token
|
Loading…
x
Reference in New Issue
Block a user