namespace Wizard;

public class ChatPostTask : BaseTask
{
	public class ChatPostTaskParam : BaseParam
	{
		public int type { get; set; }

		public string message { get; set; }
	}

	public AchievedInfo AchievedInfo { get; private set; }

	public ChatPostTask(ApiType.Type apiType)
	{
		base.type = apiType;
	}

	public void SetParameter(int type, string message)
	{
		ChatPostTaskParam chatPostTaskParam = new ChatPostTaskParam();
		chatPostTaskParam.type = type;
		chatPostTaskParam.message = message;
		base.Params = chatPostTaskParam;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		if (base.ResponseData["data"].Count > 0)
		{
			if (base.ResponseData["data"].Keys.Contains("achieved_info"))
			{
				AchievedInfo = new AchievedInfo(base.ResponseData["data"]["achieved_info"]);
			}
			if (base.ResponseData["data"].Keys.Contains("reward_list"))
			{
				PlayerStaticData.UpdateHaveUserGoodsNumByJsonData(base.ResponseData["data"]["reward_list"]);
			}
		}
		return num;
	}
}
