local ZConfigManager = {}

ZConfigManager._config = nil

function ZConfigManager:LoadConfig(szConfigName, configPath)
    print(string.format("ZConfigManager:LoadConfig szConfigName:%s configPath:%s", szConfigName, configPath))
    local jsonTextAsset = LoadResource(configPath)
    local jsonTable = self._jsonConvert:decode(jsonTextAsset.text)
    self._config[szConfigName] = jsonTable
end

function ZConfigManager:LoadAllConfig()
    -- For Example
    self:LoadConfig("configConst", "LuaScripts/Config/ConfigConst.json")

    -- todo for test
    self:LoadConfig("configScreen", "LuaScripts/Config/ConfigScreen.json")
end

function ZConfigManager:GetConfig(szConfigName)
    return self._config[szConfigName]
end

function ZConfigManager:Init()
    self._config = {}

    self._jsonConvert = require("Base/json.lua")
    self:LoadAllConfig()
end

function ZConfigManager:UnInit()
end

return ZConfigManager