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