1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-30 23:17:25 +08:00
osu-lazer/osu.Game/Rulesets/Judgements/Judgement.cs

49 lines
2.0 KiB
C#
Raw Normal View History

2018-04-13 17:19:50 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Rulesets.Objects;
2018-04-13 17:19:50 +08:00
using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Judgements
{
/// <summary>
/// The scoring information provided by a <see cref="HitObject"/>.
/// </summary>
2018-04-13 17:19:50 +08:00
public class Judgement
{
/// <summary>
/// The maximum <see cref="HitResult"/> that can be achieved.
/// </summary>
public virtual HitResult MaxResult => HitResult.Perfect;
/// <summary>
/// Whether this <see cref="Judgement"/> should affect the current combo.
2018-04-13 17:19:50 +08:00
/// </summary>
public virtual bool AffectsCombo => true;
2018-06-10 09:14:33 +08:00
/// <summary>
/// Whether this <see cref="Judgement"/> should be counted as base (combo) or bonus score.
2018-06-10 09:14:33 +08:00
/// </summary>
public virtual bool IsBonus => !AffectsCombo;
2018-06-10 09:14:33 +08:00
2018-04-13 17:19:50 +08:00
/// <summary>
/// The numeric score representation for the maximum achievable result.
2018-04-13 17:19:50 +08:00
/// </summary>
public int MaxNumericResult => NumericResultFor(MaxResult);
2018-04-13 17:19:50 +08:00
/// <summary>
/// Retrieves the numeric score representation of a <see cref="HitResult"/>.
2018-04-13 17:19:50 +08:00
/// </summary>
/// <param name="result">The <see cref="HitResult"/> to find the numeric score representation for.</param>
/// <returns>The numeric score representation of <paramref name="result"/>.</returns>
protected virtual int NumericResultFor(HitResult result) => result > HitResult.Miss ? 1 : 0;
2018-04-13 17:19:50 +08:00
/// <summary>
/// Retrieves the numeric score representation of a <see cref="JudgementResult"/>.
2018-04-13 17:19:50 +08:00
/// </summary>
/// <param name="result">The <see cref="JudgementResult"/> to find the numeric score representation for.</param>
/// <returns>The numeric score representation of <paramref name="result"/>.</returns>
public int NumericResultFor(JudgementResult result) => NumericResultFor(result.Type);
2018-04-13 17:19:50 +08:00
}
}