mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-17 11:02:27 +08:00
配置表访问接口化,简化常量访问
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/jszwec/csvutil"
|
||||
)
|
||||
|
||||
// SceneData 场景配置表
|
||||
type SceneData struct {
|
||||
SceneId int32 `csv:"SceneId"` // ID
|
||||
SceneType int32 `csv:"SceneType,omitempty"` // 类型
|
||||
@@ -28,3 +29,11 @@ func (g *GameDataConfig) loadSceneData() {
|
||||
}
|
||||
logger.Info("SceneData count: %v", len(g.SceneDataMap))
|
||||
}
|
||||
|
||||
func GetSceneDataById(sceneId int32) *SceneData {
|
||||
return CONF.SceneDataMap[sceneId]
|
||||
}
|
||||
|
||||
func GetSceneDataMap() map[int32]*SceneData {
|
||||
return CONF.SceneDataMap
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user