package controller

import (
	"blazing/common/socket/errorcode"

	"blazing/logic/service/item"
	"blazing/logic/service/player"
	"blazing/modules/blazing/model"
)

func (h Controller) UserItemList(data *item.ItemListInboundInfo, c *player.Player) (result *item.ItemListOutboundInfo, err errorcode.ErrorCode) {
	result = &item.ItemListOutboundInfo{}
	result.ItemList = make([]model.SingleItemInfo, 0)

	c.Service.Item(func(m map[uint32]model.SingleItemInfo) bool {
		for _, v := range m {
			if int32(v.ItemId) >= int32(data.Param1) && int32(v.ItemId) <= int32(data.Param2) {
				v.LeftTime = 360000
				result.ItemList = append(result.ItemList, v)
			}
		}
		return false
	})

	return result, 0
}
func (h Controller) PlayerGoldCount(data *item.GoldOnlineRemainInboundInfo, c *player.Player) (result *item.GoldOnlineRemainOutboundInfo, err errorcode.ErrorCode) {

	return &item.GoldOnlineRemainOutboundInfo{

		uint32(c.Info.GoldBean) * 100,
	}, 0
}
