ecs/servers/game/data_old/charge_ext.go
2025-06-04 18:17:39 +08:00

25 lines
406 B
Go

package data
type ChargeTableExtend struct {
*ChargeTable
extMap map[int][]*Charge
}
func (this *ChargeTableExtend) init() error {
if this.ChargeTable == nil {
return nil
}
this.extMap = map[int][]*Charge{}
for _, d := range this.l {
this.extMap[d.Type] = append(this.extMap[d.Type], d)
}
return nil
}
func (this *ChargeTableExtend) List(tipe int) []*Charge {
return this.extMap[tipe]
}