mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-11 09:52:26 +08:00
配置表访问接口化,简化常量访问
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/jszwec/csvutil"
|
||||
)
|
||||
|
||||
// FetterData 角色资料解锁配置表
|
||||
type FetterData struct {
|
||||
FetterId int32 `csv:"FetterId"` // ID
|
||||
AvatarId int32 `csv:"AvatarId"` // 角色ID
|
||||
@@ -38,3 +39,15 @@ func (g *GameDataConfig) loadFetterData() {
|
||||
}
|
||||
logger.Info("FetterData count: %v", len(g.FetterDataMap))
|
||||
}
|
||||
|
||||
func GetFetterDataByFetterId(fetterId int32) *FetterData {
|
||||
return CONF.FetterDataMap[fetterId]
|
||||
}
|
||||
|
||||
func GetFetterIdListByAvatarId(avatarId int32) []int32 {
|
||||
return CONF.FetterDataAvatarIdMap[avatarId]
|
||||
}
|
||||
|
||||
func GetFetterDataMap() map[int32]*FetterData {
|
||||
return CONF.FetterDataMap
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user