aozhiwei 7affbd8c60 1
2024-07-12 17:17:13 +08:00

33 lines
472 B
Go

package mt
import (
"q5"
"f5"
"mtb"
)
type Item struct {
mtb.Item
realName string
}
type ItemTable struct {
f5.IdMetaTable[Item]
itemIdHash *q5.ConcurrentMap[int64, *Item]
}
func (this *Item) GetRealName() string {
return this.realName
}
func (this *ItemTable) PostInit1() {
this.Traverse(
func (ele *Item) bool {
langMeta := Table.Language.GetByName(ele.GetName())
if langMeta != nil {
ele.realName = langMeta.GetEn()
}
return true
})
}