----------------------------------------------------------------------------------------
-- wrapping the MystStates object by states table
----------------------------------------------------------------------------------------

states = {}
states_mt = {}
setmetatable(states, states_mt)

local StatesObj = MystStates:GetInstance() 
function states_mt.__index(table, key)
  local st = StatesObj:Get(key)
  local no = tonumber(st)
  if no then
    return no
  end
  return st
end

function states_mt.__newindex(table, key, value)
    StatesObj:Set(key, value)
end

s = states -- alias

Config = {}
config_mt = {}
setmetatable(Config, config_mt)

function config_mt.__index(table, key)
    return Game:GetConfig():GetParameter(key)
end

function config_mt.__newindex(table, key, value)
    Game:GetConfig():SetParameter(key, value)
end

----------------------------------------------------------------------------------------