配置表访问接口化,简化常量访问

This commit is contained in:
flswld
2023-02-09 19:20:47 +08:00
parent 867448b80d
commit ae4c505e48
74 changed files with 2313 additions and 3189 deletions

View File

@@ -2,13 +2,13 @@ package gdconf
import (
"fmt"
"hk4e/pkg/logger"
"github.com/jszwec/csvutil"
)
// 武器等级配置表
// WeaponLevelData 武器等级配置表
type WeaponLevelData struct {
Level int32 `csv:"Level"` // 等级
ExpByStar1 int32 `csv:"ExpByStar1,omitempty"` // 武器升级经验1
@@ -42,3 +42,11 @@ func (g *GameDataConfig) loadWeaponLevelData() {
}
logger.Info("WeaponLevelData count: %v", len(g.WeaponLevelDataMap))
}
func GetWeaponLevelDataByLevel(level int32) *WeaponLevelData {
return CONF.WeaponLevelDataMap[level]
}
func GetWeaponLevelDataMap() map[int32]*WeaponLevelData {
return CONF.WeaponLevelDataMap
}