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

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

@@ -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
}