Centralize updating HasCompleted bindable logic

This commit is contained in:
Salman Ahmed 2020-04-20 06:40:51 +03:00
parent 65a8860a65
commit 6f233917b1
1 changed files with 4 additions and 4 deletions

View File

@ -58,8 +58,7 @@ public void ApplyResult(JudgementResult result)
NewJudgement?.Invoke(result);
if (JudgedHits == MaxHits)
hasCompleted.Value = true;
updateHasCompleted();
}
/// <summary>
@ -70,8 +69,7 @@ public void RevertResult(JudgementResult result)
{
JudgedHits--;
if (JudgedHits < MaxHits)
hasCompleted.Value = false;
updateHasCompleted();
RevertResultInternal(result);
}
@ -135,5 +133,7 @@ void simulate(HitObject obj)
ApplyResult(result);
}
}
private void updateHasCompleted() => hasCompleted.Value = JudgedHits == MaxHits;
}
}