// Code generated by excel export. DO NOT EDIT. package data var MapTile = &mapTileConfig{} func init() { _allList = append(_allList, MapTile) } type ( MapTileRow struct { ConfigID int32 `json:"ConfigID"` // 地块配置ID IsWalkable bool `json:"IsWalkable"` // 可行走 } mapTileConfig struct { baseConfig list []*MapTileRow // all list configIDUniMaps map[int32]*MapTileRow // key:configID } ) func (p *mapTileConfig) Name() string { return "map_tile" } func (p *mapTileConfig) Init() { p.configIDUniMaps = map[int32]*MapTileRow{} } func (p *mapTileConfig) OnLoad(maps interface{}, reload bool) (int, error) { if reload && p.denyLoad { return 0, nil } var list []*MapTileRow if err := DecodeData(maps, &list); err != nil { return 0, err } p.list = list configIDUniMaps := map[int32]*MapTileRow{} for _, row := range list { configIDUniMaps[row.ConfigID] = row } p.configIDUniMaps = configIDUniMaps return len(list), nil } // func (p *mapTileConfig) OnAfterLoad(_ bool) { // } func (p *mapTileConfig) List() []*MapTileRow { return p.list } func (p *mapTileConfig) GetByConfigID(configID int32) (*MapTileRow, bool) { value, found := p.configIDUniMaps[configID] return value, found } func (p *mapTileConfig) ContainConfigID(configID int32) bool { _, found := p.configIDUniMaps[configID] return found }