package inviteCfg

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

const (
	CFG_INVITE = "Invite"
)

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

func GetInviteReward(index int) (int, []*item.Item) {
	data, err := gamedata.GetDataByIntKey(CFG_INVITE, index)
	if err != nil {
		log.Debug("GetInviteReward err:%v, index=%d", err, index)
		return 0, nil
	}
	return gamedata.GetIntValue(data, "Need"), gamedata.GetItemList(data, "Items")
}
