// Code generated by excel export. DO NOT EDIT. package data import ( "f1-game/internal/types" ) var GameMainQuest = &gameMainQuestConfig{} func init() { _allList = append(_allList, GameMainQuest) } type ( GameMainQuestRow struct { ChapterID int32 `json:"ChapterID"` // 章节ID ChapterRewards types.Assets `json:"ChapterRewards"` // 章节奖励 QuestGroupID int32 `json:"QuestGroupID"` // 任务组ID NextChapterID int32 `json:"NextChapterID"` // 下一章节ID } gameMainQuestConfig struct { baseConfig list []*GameMainQuestRow // all list chapterIDUniMaps map[int32]*GameMainQuestRow // key:chapterID } ) func (p *gameMainQuestConfig) Name() string { return "game_main_quest" } func (p *gameMainQuestConfig) Init() { p.chapterIDUniMaps = map[int32]*GameMainQuestRow{} } func (p *gameMainQuestConfig) OnLoad(maps interface{}, reload bool) (int, error) { if reload && p.denyLoad { return 0, nil } var list []*GameMainQuestRow if err := DecodeData(maps, &list); err != nil { return 0, err } p.list = list chapterIDUniMaps := map[int32]*GameMainQuestRow{} for _, row := range list { chapterIDUniMaps[row.ChapterID] = row } p.chapterIDUniMaps = chapterIDUniMaps return len(list), nil } // func (p *gameMainQuestConfig) OnAfterLoad(_ bool) { // } func (p *gameMainQuestConfig) List() []*GameMainQuestRow { return p.list } func (p *gameMainQuestConfig) GetByChapterID(chapterID int32) (*GameMainQuestRow, bool) { value, found := p.chapterIDUniMaps[chapterID] return value, found } func (p *gameMainQuestConfig) ContainChapterID(chapterID int32) bool { _, found := p.chapterIDUniMaps[chapterID] return found }