package guildCfg

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

const (
	GUILD_REWARD = "GuildReward"
)

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

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