mirror of
https://github.com/ppy/osu.git
synced 2026-05-30 15:05:05 +08:00
Make assertion completely dead in release mode
This commit is contained in:
@@ -22,9 +22,16 @@ namespace osu.Game.Rulesets.Scoring
|
||||
|
||||
protected HitWindows()
|
||||
{
|
||||
var availableWindows = GetAllAvailableWindows();
|
||||
ensureValidHitWindows();
|
||||
}
|
||||
|
||||
[Conditional("DEBUG")]
|
||||
private void ensureValidHitWindows()
|
||||
{
|
||||
var availableWindows = GetAllAvailableWindows().ToList();
|
||||
Debug.Assert(availableWindows.Any(r => r.result == HitResult.Miss), $"{nameof(GetAllAvailableWindows)} should always contain {nameof(HitResult.Miss)}");
|
||||
Debug.Assert(availableWindows.Any(r => r.result != HitResult.Miss), $"{nameof(GetAllAvailableWindows)} should always contain at least one result type other than {nameof(HitResult.Miss)}.");
|
||||
Debug.Assert(availableWindows.Any(r => r.result != HitResult.Miss),
|
||||
$"{nameof(GetAllAvailableWindows)} should always contain at least one result type other than {nameof(HitResult.Miss)}.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user