namespace Wizard;

public class AcceptAgreementTask : BaseTask
{
	private class Param : BaseParam
	{
		public int agreement_type;

		public int agreement_id;
	}

	public enum Type
	{
		TOS = 1,
		PrivacyPolicy,
		KorAuthority
	}

	private Type _agreedType;

	public static int _tosId;

	public static int _privacyPolicyId;

	public static int KorAuthorityId;

	public AcceptAgreementTask()
	{
		base.type = ApiType.Type.AcceptAgreement;
	}

	public void SetParameter(Type agreedType)
	{
		_agreedType = agreedType;
		Param param = new Param();
		param.agreement_type = (int)agreedType;
		switch (agreedType)
		{
		case Type.TOS:
			param.agreement_id = _tosId;
			break;
		case Type.PrivacyPolicy:
			param.agreement_id = _privacyPolicyId;
			break;
		case Type.KorAuthority:
			param.agreement_id = KorAuthorityId;
			break;
		}
		base.Params = param;
	}

	protected override int Parse()
	{
		int num = base.Parse();
		if (num != 1)
		{
			return num;
		}
		switch (_agreedType)
		{
		case Type.TOS:
			PlayerStaticData._tosAgreementState = PlayerStaticData.AgreementState.Agreed;
			break;
		case Type.PrivacyPolicy:
			PlayerStaticData._privacyPolicyAgreementState = PlayerStaticData.AgreementState.Agreed;
			break;
		case Type.KorAuthority:
			PlayerStaticData.KorAuthorityAgreementState = PlayerStaticData.AgreementState.Agreed;
			break;
		}
		return num;
	}
}
