using System.Collections.Generic;
using LitJson;

namespace Wizard;

public class GatheringFriendListTask : BaseTask
{
	public class InviteFriendData : GatheringUserInfo
	{
		public bool IsJoinGathering { get; private set; }

		public bool IsInvited { get; private set; }

		public InviteFriendData(JsonData data, bool isJoinedGuild, bool isInvited)
			: base(data)
		{
			IsJoinGathering = isJoinedGuild;
			IsInvited = isInvited;
		}
	}

	public List<InviteFriendData> InviteFriendList { get; private set; }

	public GatheringFriendListTask()
	{
		base.type = ApiType.Type.GatheringFriendList;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		InviteFriendList = new List<InviteFriendData>();
		JsonData jsonData = base.ResponseData["data"];
		for (int i = 0; i < jsonData.Count; i++)
		{
			JsonData jsonData2 = jsonData[i];
			InviteFriendData item = new InviteFriendData(jsonData2, jsonData2["is_join_gathering"].ToBoolean(), jsonData2["is_invited"].ToBoolean());
			InviteFriendList.Add(item);
		}
		return num;
	}
}
