// Code generated by excel export. DO NOT EDIT. package data import ( "f1-game/internal/types" ) var MapMonster = &mapMonsterConfig{} func init() { _allList = append(_allList, MapMonster) } type ( MapMonsterRow struct { ConfigID int32 `json:"ConfigID"` // 怪物配置ID Level int32 `json:"Level"` // 等级 Armies types.Pair[int32, int] `json:"Armies"` // 部队 Rewards types.Assets `json:"Rewards"` // 奖励 RandomRewardPools types.PairList[int32, int] `json:"RandomRewardPools"` // 随机奖励库 } mapMonsterConfig struct { baseConfig list []*MapMonsterRow // all list configIDUniMaps map[int32]*MapMonsterRow // key:configID } ) func (p *mapMonsterConfig) Name() string { return "map_monster" } func (p *mapMonsterConfig) Init() { p.configIDUniMaps = map[int32]*MapMonsterRow{} } func (p *mapMonsterConfig) OnLoad(maps interface{}, reload bool) (int, error) { if reload && p.denyLoad { return 0, nil } var list []*MapMonsterRow if err := DecodeData(maps, &list); err != nil { return 0, err } p.list = list configIDUniMaps := map[int32]*MapMonsterRow{} for _, row := range list { configIDUniMaps[row.ConfigID] = row } p.configIDUniMaps = configIDUniMaps return len(list), nil } // func (p *mapMonsterConfig) OnAfterLoad(_ bool) { // } func (p *mapMonsterConfig) List() []*MapMonsterRow { return p.list } func (p *mapMonsterConfig) GetByConfigID(configID int32) (*MapMonsterRow, bool) { value, found := p.configIDUniMaps[configID] return value, found } func (p *mapMonsterConfig) ContainConfigID(configID int32) bool { _, found := p.configIDUniMaps[configID] return found }