public bool IsOkayForSettings(PBESettings settings) { settings.ShouldBeReadOnly(nameof(settings)); if (_requiredSettings is not null) { return(settings.Equals(_requiredSettings)); } if (this is PBETrainerInfo ti && ti.GainsEXP && settings.MaxLevel > 100) { throw new ArgumentException("Cannot start a battle with EXP enabled and a higher MaxLevel than 100. Not supported."); } return(true); }
public bool IsOkayForSettings(PBESettings settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } if (!settings.IsReadOnly) { throw new ArgumentException("Settings must be read-only.", nameof(settings)); } if (_requiredSettings != null) { return(settings.Equals(_requiredSettings)); } return(true); }