Enforce exception better

This commit is contained in:
Dean Herbert
2017-06-15 14:48:02 +09:00
parent 585e7ba312
commit 32226f90db
2 changed files with 8 additions and 8 deletions

View File

@ -40,11 +40,11 @@ namespace osu.Game.Rulesets.Timing
/// <param name="hitObject">The hit object to add.</param>
public void Add(DrawableHitObject hitObject)
{
if (hitObject.RelativePositionAxes == Axes.None)
throw new InvalidOperationException($"Make sure to set all {nameof(DrawableHitObject)}'s {nameof(RelativePositionAxes)} to some axis of relativity");
var target = adjustmentContainerFor(hitObject);
if (hitObject.RelativePositionAxes != target.ScrollingAxes)
throw new InvalidOperationException($"Make sure to set all {nameof(DrawableHitObject)}'s {nameof(RelativePositionAxes)} are equal to the correct axes of scrolling ({target.ScrollingAxes}).");
if (target == null)
throw new ArgumentException("No speed adjustment could be found that can contain the hit object.", nameof(hitObject));