using LitJson;

namespace Wizard;

public class PracticeDeckInfoTask : BaseTask
{
	public class PracticeDeckInfoTaskParam : BaseParam
	{
		public int deck_format;
	}

	public DeckGroupListData DeckGroupListData { get; private set; }

	public PracticeDeckInfoTask()
	{
		base.type = ApiType.Type.PracticeDeckInfo;
		base.Params = new PracticeDeckInfoTaskParam
		{
			deck_format = Data.FormatConvertApi(Format.All)
		};
	}

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