package randnameCfg

import (
	"server/GoUtil"
	"server/gamedata"
)

const (
	CFG_RAND_NAME = "RandName"
)

func init() {
	gamedata.InitCfg(CFG_RAND_NAME)
}

func GetRandName() string {
	data, _ := gamedata.GetData(CFG_RAND_NAME)
	Id := GoUtil.RandNum(1, len(data))
	v, err := gamedata.GetDataByIntKey(CFG_RAND_NAME, Id)
	if err != nil {
		return "Lily"
	}
	return gamedata.GetStringValue(v, "EnName")
}
