// Code generated by excel export. DO NOT EDIT. package data import ( "f1-game/internal/enum" "f1-game/internal/types" ) var SeasonQuest = &seasonQuestConfig{} func init() { _allList = append(_allList, SeasonQuest) } type ( SeasonQuestRow struct { ID int32 `json:"ID"` // 霸业ID NextID int32 `json:"NextID"` // 下一个霸业ID QuestType enum.SeasonQuestType `json:"QuestType"` // 任务类型 QuestParams types.List[int32] `json:"QuestParams"` // 任务参数 Rewards types.Assets `json:"Rewards"` // 任务奖励 QuestDuration int64 `json:"QuestDuration"` // 任务时长(分) UnlockFunc types.List[int32] `json:"UnlockFunc"` // 解锁功能 } seasonQuestConfig struct { baseConfig list []*SeasonQuestRow // all list idUniMaps map[int32]*SeasonQuestRow // key:id } ) func (p *seasonQuestConfig) Name() string { return "season_quest" } func (p *seasonQuestConfig) Init() { p.idUniMaps = map[int32]*SeasonQuestRow{} } func (p *seasonQuestConfig) OnLoad(maps interface{}, reload bool) (int, error) { if reload && p.denyLoad { return 0, nil } var list []*SeasonQuestRow if err := DecodeData(maps, &list); err != nil { return 0, err } p.list = list idUniMaps := map[int32]*SeasonQuestRow{} for _, row := range list { idUniMaps[row.ID] = row } p.idUniMaps = idUniMaps return len(list), nil } // func (p *seasonQuestConfig) OnAfterLoad(_ bool) { // } func (p *seasonQuestConfig) List() []*SeasonQuestRow { return p.list } func (p *seasonQuestConfig) GetByID(id int32) (*SeasonQuestRow, bool) { value, found := p.idUniMaps[id] return value, found } func (p *seasonQuestConfig) ContainID(id int32) bool { _, found := p.idUniMaps[id] return found }