namespace Wizard;

public class DeckInfoTask : BaseTask
{
	public class DeckInfoTaskParam : BaseParam
	{
		public int deck_format;
	}

	public class DeckInfoTaskParamForCopySrcGet : BaseParam
	{
		public int deck_format;

		public int create_deck_format;
	}

	private Format _format;

	public DeckGroupListData DeckGroupListData { get; private set; }

	public DeckInfoTask(bool isRoom = false)
	{
		if (isRoom)
		{
			base.type = ApiType.Type.OpenRoomDeckInfo;
		}
		else
		{
			base.type = ApiType.Type.DeckInfo;
		}
	}

	public void SetParameter(Format format)
	{
		DeckInfoTaskParam deckInfoTaskParam = new DeckInfoTaskParam();
		deckInfoTaskParam.deck_format = Data.FormatConvertApi(format);
		base.Params = deckInfoTaskParam;
		_format = format;
	}

	public void SetParameterForCopySrcGet(Format format, Format copyTargetFormat)
	{
		DeckInfoTaskParamForCopySrcGet deckInfoTaskParamForCopySrcGet = new DeckInfoTaskParamForCopySrcGet();
		deckInfoTaskParamForCopySrcGet.deck_format = Data.FormatConvertApi(format);
		deckInfoTaskParamForCopySrcGet.create_deck_format = Data.FormatConvertApi(copyTargetFormat);
		base.Params = deckInfoTaskParamForCopySrcGet;
		_format = format;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		GameMgr.GetIns().GetDataMgr().SetMaintenanceCardIds(base.ResponseData["data"]["maintenance_card_list"]);
		DeckGroupListData = new DeckGroupListData(base.ResponseData["data"], _format);
		GameMgr.GetIns().GetDataMgr().CurrentDeckListParamData = DeckGroupListData;
		return num;
	}
}
