// 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 }