25 lines
406 B
Go
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]
|
|
}
|