mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
地牢场景传送
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package gdconf
|
||||
|
||||
import (
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
|
||||
// DungeonData 地牢配置表
|
||||
type DungeonData struct {
|
||||
DungeonId int32 `csv:"ID"`
|
||||
SceneId int32 `csv:"场景ID,omitempty"`
|
||||
}
|
||||
|
||||
func (g *GameDataConfig) loadDungeonData() {
|
||||
g.DungeonDataMap = make(map[int32]*DungeonData)
|
||||
dungeonDataList := make([]*DungeonData, 0)
|
||||
readTable[DungeonData](g.txtPrefix+"DungeonData.txt", &dungeonDataList)
|
||||
for _, dungeonData := range dungeonDataList {
|
||||
g.DungeonDataMap[dungeonData.DungeonId] = dungeonData
|
||||
}
|
||||
logger.Info("DungeonData count: %v", len(g.DungeonDataMap))
|
||||
}
|
||||
|
||||
func GetDungeonDataById(dungeonId int32) *DungeonData {
|
||||
return CONF.DungeonDataMap[dungeonId]
|
||||
}
|
||||
|
||||
func GetDungeonDataMap() map[int32]*DungeonData {
|
||||
return CONF.DungeonDataMap
|
||||
}
|
||||
Reference in New Issue
Block a user