namespace Wizard;

public class FreeCardPackCampaignFinishTask : BaseTask
{
	public class FreeCardPackCampaignFinishTaskParam : BaseParam
	{
		public int campaign_id { get; set; }

		public int prize { get; set; }

		public int opened_box { get; set; }
	}

	public FreeCardPackCampaignFinishTask()
	{
		base.type = ApiType.Type.FreeCardPackBoxFinish;
	}

	public void SetParameter(int campaignId, int prizeId, int openedBox)
	{
		FreeCardPackCampaignFinishTaskParam freeCardPackCampaignFinishTaskParam = new FreeCardPackCampaignFinishTaskParam();
		freeCardPackCampaignFinishTaskParam.campaign_id = campaignId;
		freeCardPackCampaignFinishTaskParam.prize = prizeId;
		freeCardPackCampaignFinishTaskParam.opened_box = openedBox;
		base.Params = freeCardPackCampaignFinishTaskParam;
	}

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