miduo_client/Assets/ManagedResources/~Lua/Modules/RatioNumber/RatioNumberLevelManager.lua

82 lines
2.0 KiB
Lua

RatioNumberLevelManager = {}
local this = RatioNumberLevelManager
local chapterInfo = ConfigManager.GetConfig(ConfigName.CompareNumChaper)
this.chapterList = {}
-- function this.Initialize()
-- this.ChapterHandle()
-- end
local allChapterData = {}--所有章节信息
this.chapterCount = 0
function this.ChapterHandle()
this.chapterList = {}
for _,config in ConfigPairs(chapterInfo) do
if config then
local chapter = {}
chapter.chapter= config
chapter.state = 0
chapter.levelInfo = ConfigManager.GetAllConfigsDataByKey(ConfigName.CompareNumSetting,"Chapter",config.ID)
table.insert(this.chapterList,chapter)
end
end
this.chapterCount = #this.chapterList
end
function this.GetChapterLevelInfo(chapter,level)
return this.chapterList[chapter].levelInfo[level]
end
function this.GetChapterInfo(chapter)
return this.chapterList[chapter]
end
function this.GetChapterReward()
return this.chapterList[RatioNumberManager.selectChapterId].chapter.Reward
end
function this.GetAllChapterInfo()
local chapterInfo = {}
for i = 1, #this.chapterList do
local chapter = this.chapterList[i].chapter
table.insert(chapterInfo,chapter)
end
return chapterInfo
end
function this.GetCurChapter()
local index = 1
for i = 1, #this.chapterList do
local chapter = this.chapterList[i].chapter
local limit = chapter.Limit
for j = 1, #limit do
local tj = limit[j]
if tj[1] == 1 then
if PlayerManager.level >= tj[2] then
if i > index then
index = i
end
end
elseif tj[1] == 2 then
if FightPointPassManager.curOpenFight > tj[2] then
if i > index then
index = i
end
end
end
end
end
return index
end
return RatioNumberLevelManager