Throw rather than ignore on invalid control point addition

This commit is contained in:
Dean Herbert 2021-09-06 22:04:37 +09:00
parent ce197b6322
commit eabca016d4
2 changed files with 8 additions and 3 deletions

View File

@ -276,6 +276,9 @@ protected virtual void GroupItemAdded(ControlPoint controlPoint)
case EffectControlPoint typed:
effectPoints.Add(typed);
break;
default:
throw new ArgumentException($"A control point of unexpected type {controlPoint.GetType()} was added to this {nameof(ControlPointInfo)}");
}
}

View File

@ -73,14 +73,16 @@ protected override void GroupItemAdded(ControlPoint controlPoint)
{
case SampleControlPoint typed:
samplePoints.Add(typed);
break;
return;
case DifficultyControlPoint typed:
difficultyPoints.Add(typed);
return;
default:
base.GroupItemAdded(controlPoint);
break;
}
base.GroupItemAdded(controlPoint);
}
protected override void GroupItemRemoved(ControlPoint controlPoint)