35 lines
639 B
Go
35 lines
639 B
Go
![]() |
package data
|
||
|
|
||
|
type CopySpeedTableExtend struct {
|
||
|
*CopySpeedTable
|
||
|
|
||
|
types []int
|
||
|
extMap map[int]*CopySpeed
|
||
|
}
|
||
|
|
||
|
func (this *CopySpeedTableExtend) init() error {
|
||
|
if this.CopySpeedTable == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
var types = map[int]struct{}{}
|
||
|
this.extMap = map[int]*CopySpeed{}
|
||
|
for _, d := range this.CopySpeedTable.l {
|
||
|
types[d.CopyType] = struct{}{}
|
||
|
this.extMap[d.SceneId] = d
|
||
|
}
|
||
|
|
||
|
for tipe := range types {
|
||
|
this.types = append(this.types, tipe)
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (this *CopySpeedTableExtend) Get(sceneId int) *CopySpeed {
|
||
|
return this.extMap[sceneId]
|
||
|
}
|
||
|
|
||
|
func (this *CopySpeedTableExtend) Types() []int {
|
||
|
return this.types
|
||
|
}
|