mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:42:55 +08:00
Move validation to DHO.ApplyResult()
This commit is contained in:
parent
18d20cad8b
commit
a1a46e58fc
@ -672,6 +672,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
if (!Result.HasResult)
|
if (!Result.HasResult)
|
||||||
throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}.");
|
throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}.");
|
||||||
|
|
||||||
|
HitResultExtensions.ValidateHitResultPair(Result.Judgement.MaxResult, Result.Judgement.MinResult);
|
||||||
|
|
||||||
if (!Result.Type.IsValidHitResult(Result.Judgement.MinResult, Result.Judgement.MaxResult))
|
if (!Result.Type.IsValidHitResult(Result.Judgement.MinResult, Result.Judgement.MaxResult))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(
|
throw new InvalidOperationException(
|
||||||
|
@ -151,8 +151,6 @@ namespace osu.Game.Rulesets.Scoring
|
|||||||
{
|
{
|
||||||
var judgement = obj.CreateJudgement();
|
var judgement = obj.CreateJudgement();
|
||||||
|
|
||||||
HitResultExtensions.ValidateHitResultPair(judgement.MaxResult, judgement.MinResult);
|
|
||||||
|
|
||||||
var result = CreateResult(obj, judgement);
|
var result = CreateResult(obj, judgement);
|
||||||
if (result == null)
|
if (result == null)
|
||||||
throw new InvalidOperationException($"{GetType().ReadableName()} must provide a {nameof(JudgementResult)} through {nameof(CreateResult)}.");
|
throw new InvalidOperationException($"{GetType().ReadableName()} must provide a {nameof(JudgementResult)} through {nameof(CreateResult)}.");
|
||||||
|
Loading…
Reference in New Issue
Block a user