package guidecfg

import (
	"server/game/mod/item"
	"server/gamedata"
	"server/pkg/github.com/name5566/leaf/log"
)

const (
	GUIDE_REWARD = "GuideReward"
)

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

func GetGuideReward(Id int) ([]*item.Item, int) {
	data, err := gamedata.GetDataByIntKey(GUIDE_REWARD, Id)
	if err != nil {
		log.Debug("GetGuideReward err:%v, Id=%d", err, Id)
		return nil, 0
	}
	return item.ParseItem(gamedata.GetValue(data, "Items")), gamedata.GetIntValue(data, "Num")
}
