PGRData/Script/matrix/xconfig/XFightPasswordConfigs.lua

22 lines
762 B
Lua
Raw Permalink Normal View History

2024-09-01 20:49:41 +00:00
local TABLE_PASSWORD_PATH = "Client/Fight/PasswordGame/FightPasswordGame.tab"
local PasswordGameConfigs = {}
XFightPasswordConfigs = XFightPasswordConfigs or {}
function XFightPasswordConfigs.Init()
PasswordGameConfigs = XTableManager.ReadByIntKey(TABLE_PASSWORD_PATH, XTable.XTableFightPasswordGame, "Id")
end
local GetPasswordGameConfig = function(id)
local config = PasswordGameConfigs[id]
if not config then
XLog.ErrorTableDataNotFound("XFightPasswordConfigs.GetPasswordGameConfig", "PasswordGameConfigs", TABLE_PASSWORD_PATH, "Id", id)
return
end
return config
end
function XFightPasswordConfigs.GetCorrectPassword(id, index)
local config = GetPasswordGameConfig(id)
return config.CorrectPasswords[index]
end