using LitJson;

namespace Wizard;

public class PracticePuzzleListTask : BaseTask
{
	public class PracticePuzzleListTaskParam : BaseParam
	{
		public int puzzle_master_id;
	}

	public bool IsDisplayBadge { get; private set; }

	public PuzzleQuestInfo PuzzleQuestInfo { get; private set; }

	public PracticePuzzleListTask()
	{
		base.type = ApiType.Type.PracticePuzzleList;
	}

	public void SetParameter(int puzzleGroupId)
	{
		PracticePuzzleListTaskParam practicePuzzleListTaskParam = new PracticePuzzleListTaskParam();
		practicePuzzleListTaskParam.puzzle_master_id = puzzleGroupId;
		base.Params = practicePuzzleListTaskParam;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		JsonData jsonData = base.ResponseData["data"];
		IsDisplayBadge = jsonData["is_display_badge"].ToBoolean();
		PuzzleQuestInfo = new PuzzleQuestInfo(jsonData);
		return num;
	}
}
