namespace Wizard.Scripts.Network.Data.TaskData.ItemPurchase;

public class ItemPurchaseBuyTask : BaseTask
{
	public class ItemPurchaseBuyTaskParam : BaseParam
	{
		public int purchase_id;

		public int rest;
	}

	public ItemPurchaseBuyTask()
	{
		base.type = ApiType.Type.ItemPurchaseBuy;
	}

	public void SetParameter(int purchaseId, int rest)
	{
		ItemPurchaseBuyTaskParam itemPurchaseBuyTaskParam = new ItemPurchaseBuyTaskParam();
		itemPurchaseBuyTaskParam.purchase_id = purchaseId;
		itemPurchaseBuyTaskParam.rest = rest;
		base.Params = itemPurchaseBuyTaskParam;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
		return num;
	}
}
