| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- import (
- "f1-game/internal/types"
- )
- var LordShow = &lordShowConfig{}
- func init() {
- _allList = append(_allList, LordShow)
- }
- type (
- LordShowRow struct {
- ShowID int32 `json:"ShowID"` // 外显ID
- Type int32 `json:"type"` // 类型
- ActiveCondition types.Pair[int32, int32] `json:"activeCondition"` // 激活条件
- ExpireTime int32 `json:"expireTime"` // 有效时间(s)
- }
- lordShowConfig struct {
- baseConfig
- list []*LordShowRow // all list
- showIDUniMaps map[int32]*LordShowRow // key:showID
- }
- )
- func (p *lordShowConfig) Name() string {
- return "lord_show"
- }
- func (p *lordShowConfig) Init() {
- p.showIDUniMaps = map[int32]*LordShowRow{}
- }
- func (p *lordShowConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*LordShowRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- showIDUniMaps := map[int32]*LordShowRow{}
- for _, row := range list {
- showIDUniMaps[row.ShowID] = row
- }
- p.showIDUniMaps = showIDUniMaps
- return len(list), nil
- }
- // func (p *lordShowConfig) OnAfterLoad(_ bool) {
- // }
- func (p *lordShowConfig) List() []*LordShowRow {
- return p.list
- }
- func (p *lordShowConfig) GetByShowID(showID int32) (*LordShowRow, bool) {
- value, found := p.showIDUniMaps[showID]
- return value, found
- }
- func (p *lordShowConfig) ContainShowID(showID int32) bool {
- _, found := p.showIDUniMaps[showID]
- return found
- }
|