namespace Wizard;

public class FreeBattleFinishTask : FinishTaskBase
{
	public FreeBattleFinishTask()
	{
		switch (Data.CurrentFormat)
		{
		case Format.Rotation:
			base.type = ApiType.Type.FreeMatchFinishRotation;
			break;
		case Format.Unlimited:
			base.type = ApiType.Type.FreeMatchFinishUnlimited;
			break;
		case Format.PreRotation:
			base.type = ApiType.Type.FreeMatchFinishPreRotation;
			break;
		case Format.Crossover:
			base.type = ApiType.Type.FreeMatchFinishCrossover;
			break;
		case Format.MyRotation:
			base.type = ApiType.Type.FreeMatchFinishMyRotation;
			break;
		case Format.Avatar:
			base.type = ApiType.Type.FreeMatchFinishAvatar;
			break;
		}
		Data.FreeMatchFinish.data = null;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (IsEffectiveErrorCode(num))
		{
			return num;
		}
		Data.FreeMatchFinish.data = new FreeMatchFinishDetail();
		if (!IsResponseDataExist(base.ResponseData))
		{
			return num;
		}
		new BattleFinishResponsProcessing().Processing(base.ResponseData, Data.FreeMatchFinish.data);
		return num;
	}
}
