| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- // Code generated by excel export. DO NOT EDIT.
- package data
- var MapMonsterArea = &mapMonsterAreaConfig{}
- func init() {
- _allList = append(_allList, MapMonsterArea)
- }
- type (
- MapMonsterAreaRow struct {
- MonsterAreaID int32 `json:"MonsterAreaID"` // 怪物区域ID
- MonsterConfigID int32 `json:"MonsterConfigID"` // 怪物配置ID
- Num int32 `json:"Num"` // 数量
- }
- mapMonsterAreaConfig struct {
- baseConfig
- list []*MapMonsterAreaRow // all list
- monsterAreaIDListMaps map[int32][]*MapMonsterAreaRow // key:monsterAreaID
- }
- )
- func (p *mapMonsterAreaConfig) Name() string {
- return "map_monster_area"
- }
- func (p *mapMonsterAreaConfig) Init() {
- p.monsterAreaIDListMaps = map[int32][]*MapMonsterAreaRow{}
- }
- func (p *mapMonsterAreaConfig) OnLoad(maps interface{}, reload bool) (int, error) {
- if reload && p.denyLoad {
- return 0, nil
- }
- var list []*MapMonsterAreaRow
- if err := DecodeData(maps, &list); err != nil {
- return 0, err
- }
- p.list = list
- monsterAreaIDListMaps := map[int32][]*MapMonsterAreaRow{}
- for _, row := range list {
- monsterAreaIDListMaps[row.MonsterAreaID] = append(monsterAreaIDListMaps[row.MonsterAreaID], row)
- }
- p.monsterAreaIDListMaps = monsterAreaIDListMaps
- return len(list), nil
- }
- // func (p *mapMonsterAreaConfig) OnAfterLoad(_ bool) {
- // }
- func (p *mapMonsterAreaConfig) List() []*MapMonsterAreaRow {
- return p.list
- }
- func (p *mapMonsterAreaConfig) ListByMonsterAreaID(monsterAreaID int32) ([]*MapMonsterAreaRow, bool) {
- value, found := p.monsterAreaIDListMaps[monsterAreaID]
- return value, found
- }
- func (p *mapMonsterAreaConfig) ListContainMonsterAreaID(monsterAreaID int32) bool {
- _, found := p.monsterAreaIDListMaps[monsterAreaID]
- return found
- }
|