27 lines
572 B
Go
27 lines
572 B
Go
![]() |
package data
|
||
|
|
||
|
import "github.com/oylshe1314/framework/util"
|
||
|
|
||
|
type TalentLevelTableExtend struct {
|
||
|
*TalentLevelTable
|
||
|
|
||
|
extMap map[uint64]*TalentLevel
|
||
|
}
|
||
|
|
||
|
func (this *TalentLevelTableExtend) init() error {
|
||
|
if this.TalentLevelTable == nil {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
this.extMap = map[uint64]*TalentLevel{}
|
||
|
for _, d := range this.l {
|
||
|
this.extMap[util.Compose2uint32(uint32(d.TalentId), uint32(d.Level))] = d
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (this *TalentLevelTableExtend) Get(talentId, level int) *TalentLevel {
|
||
|
return this.extMap[util.Compose2uint32(uint32(talentId), uint32(level))]
|
||
|
}
|