mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
配置表访问接口化,简化常量访问
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/jszwec/csvutil"
|
||||
)
|
||||
|
||||
// GatherData 采集物配置表
|
||||
type GatherData struct {
|
||||
PointType int32 `csv:"PointType"` // 挂节点类型
|
||||
GatherId int32 `csv:"GatherId"` // ID
|
||||
@@ -32,3 +33,15 @@ func (g *GameDataConfig) loadGatherData() {
|
||||
}
|
||||
logger.Info("GatherData count: %v", len(g.GatherDataMap))
|
||||
}
|
||||
|
||||
func GetGatherDataById(gatherId int32) *GatherData {
|
||||
return CONF.GatherDataMap[gatherId]
|
||||
}
|
||||
|
||||
func GetGatherDataByPointType(pointType int32) *GatherData {
|
||||
return CONF.GatherDataPointTypeMap[pointType]
|
||||
}
|
||||
|
||||
func GetGatherDataMap() map[int32]*GatherData {
|
||||
return CONF.GatherDataMap
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user