| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- var LeagueQuest = &leagueQuestConfig{}
- func init() {
- _allList = append(_allList, LeagueQuest)
- }
- type (
- LeagueQuestRow struct {
- ChapterID int32 `json:"ChapterID"` // 章节ID
- QuestType int32 `json:"questType"` // 任务类型
- QuestGroupID int32 `json:"questGroupID"` // 任务组ID
- }
- leagueQuestConfig struct {
- baseConfig
- list []*LeagueQuestRow // all list
- chapterIDUniMaps map[int32]*LeagueQuestRow // key:chapterID
- }
- )
- func (p *leagueQuestConfig) Name() string {
- return "league_quest"
- }
- func (p *leagueQuestConfig) Init() {
- p.chapterIDUniMaps = map[int32]*LeagueQuestRow{}
- }
- func (p *leagueQuestConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*LeagueQuestRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- chapterIDUniMaps := map[int32]*LeagueQuestRow{}
- for _, row := range list {
- chapterIDUniMaps[row.ChapterID] = row
- }
- p.chapterIDUniMaps = chapterIDUniMaps
- return len(list), nil
- }
- // func (p *leagueQuestConfig) OnAfterLoad(_ bool) {
- // }
- func (p *leagueQuestConfig) List() []*LeagueQuestRow {
- return p.list
- }
- func (p *leagueQuestConfig) GetByChapterID(chapterID int32) (*LeagueQuestRow, bool) {
- value, found := p.chapterIDUniMaps[chapterID]
- return value, found
- }
- func (p *leagueQuestConfig) ContainChapterID(chapterID int32) bool {
- _, found := p.chapterIDUniMaps[chapterID]
- return found
- }
|