using System.Collections.Generic;
using LitJson;

namespace Wizard;

public class GatheringGetSelfInfoTask : BaseTask
{
	public GatheringInfo Info { get; private set; }

	public bool HasInvite { get; private set; }

	public GatheringEntrySetting EntrySetting { get; private set; }

	public List<int> ChatStampList { get; private set; } = new List<int>();

	public string _hashTags { get; private set; }

	public GatheringGetSelfInfoTask(bool isDependGatheringInfo)
	{
		base.type = (isDependGatheringInfo ? ApiType.Type.GatheringInfoDependJoin : ApiType.Type.GatheringSelfInfo);
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		JsonData jsonData = base.ResponseData["data"];
		if (jsonData.Keys.Contains("has_invite"))
		{
			HasInvite = jsonData["has_invite"].ToInt() != 0;
		}
		if (jsonData.Count == 0 || !jsonData.Keys.Contains("gathering"))
		{
			Info = new GatheringInfo();
			return num;
		}
		Info = new GatheringInfo(jsonData);
		EntrySetting = new GatheringEntrySetting(Info.Rule);
		JsonData jsonData2 = jsonData["usable_stamp_list"];
		for (int i = 0; i < jsonData2.Count; i++)
		{
			ChatStampList.Add(jsonData2[i].ToInt());
		}
		_hashTags = jsonData["hash_tag"].ToString();
		return num;
	}
}
