mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-15 14:12:27 +08:00
配置表访问接口化,简化常量访问
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user