using LitJson;

namespace Wizard;

public class GatheringAutoJoinTaskInfo
{
	public BaseRoomBattleEnterRoomTask BaseRoomBattleEnterRoomTask { get; set; }

	public string RoomId { get; private set; }

	public string DisplayRoomId { get; private set; }

	public bool IsOwner { get; private set; }

	public bool NeedsRetry { get; private set; }

	public GatheringInfo GatheringInfo { get; private set; }

	public bool IsEntryRoom { get; private set; }

	public GatheringAutoJoinTaskInfo(JsonData ResponseData, BaseRoomBattleEnterRoomTask baseRoomBattleEnterRoomTask, GatheringInfo gatheringInfo)
	{
		GatheringInfo = gatheringInfo;
		BaseRoomBattleEnterRoomTask = baseRoomBattleEnterRoomTask;
		if (!ResponseData.TryGetValue("data", out var value))
		{
			return;
		}
		if (value.TryGetValue("result_reason", out var value2))
		{
			NeedsRetry = value2.ToInt() == 12;
		}
		if (value.IsObject && value.TryGetValue("is_owner", out var value3))
		{
			IsOwner = value3.ToInt() != 0;
			if (value.TryGetValue("room_id", out var value4))
			{
				RoomId = value4.ToString();
			}
			if (value.TryGetValue("display_room_id", out var value5))
			{
				DisplayRoomId = value5.ToString();
			}
			if (value.TryGetValue("oppo_info", out var value6))
			{
				IsEntryRoom = value6 != null;
			}
		}
	}
}
