I tested it base functionality and it works.
With it you can safe any primitive type in MM2, you can also save any other but I can't guarantee what happened than anything will cast to a pointer than and pushed back as userdata than.
primitives are:
bool, int, float, string,char
not primitives are:
functions, tables, coroutines
API(short):
Code: Select all
-- bring a value to the map
map.set(string_key, primitive_value);
-- get a value out of the map
local value = map.get(string_key);
--check if a value in the map
local bool_var = map.has(string_key);
--clear the whole map
map.clear().
--remove a value
map.remove(string_key);
There is also for each function another version with a u for unsigned int e.g. map.getu(string_key).(not so tested)
The int values are 64-bit intern.
PS: e.g The LT_FUNCTION ~= LUA_TFUNCTION was kinda confusing