1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 18:07:25 +08:00
osu-lazer/osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs

89 lines
3.2 KiB
C#
Raw Normal View History

2017-03-15 20:32:47 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Modes.Judgements;
using osu.Framework.Extensions;
namespace osu.Game.Modes.Taiko.Judgements
{
public class TaikoJudgement : Judgement
{
2017-03-17 16:06:34 +08:00
/// <summary>
/// The maximum result.
2017-03-17 16:06:34 +08:00
/// </summary>
2017-03-21 20:38:39 +08:00
public const TaikoHitResult MAX_HIT_RESULT = TaikoHitResult.Great;
2017-03-17 16:06:34 +08:00
/// <summary>
/// The result.
2017-03-17 16:06:34 +08:00
/// </summary>
2017-03-21 20:36:05 +08:00
public TaikoHitResult TaikoResult;
2017-03-17 16:06:34 +08:00
/// <summary>
/// The result value for the combo portion of the score.
2017-03-17 16:06:34 +08:00
/// </summary>
public int ResultValueForScore => NumericResultForScore(TaikoResult);
2017-03-17 16:06:34 +08:00
/// <summary>
/// The result value for the accuracy portion of the score.
2017-03-17 16:06:34 +08:00
/// </summary>
public int ResultValueForAccuracy => NumericResultForAccuracy(TaikoResult);
2017-03-17 16:06:34 +08:00
/// <summary>
/// The maximum result value for the combo portion of the score.
2017-03-17 16:06:34 +08:00
/// </summary>
public int MaxResultValueForScore => NumericResultForScore(MAX_HIT_RESULT);
2017-03-17 16:06:34 +08:00
/// <summary>
/// The maximum result value for the accuracy portion of the score.
2017-03-17 16:06:34 +08:00
/// </summary>
public int MaxResultValueForAccuracy => NumericResultForAccuracy(MAX_HIT_RESULT);
2017-03-17 16:06:34 +08:00
public override string ResultString => TaikoResult.GetDescription();
public override string MaxResultString => MAX_HIT_RESULT.GetDescription();
2017-03-17 16:06:34 +08:00
/// <summary>
/// Whether this Judgement has a secondary hit in the case of strong hits.
2017-03-17 16:06:34 +08:00
/// </summary>
public virtual bool SecondHit { get; set; }
2017-03-17 16:06:34 +08:00
/// <summary>
/// Computes the numeric result value for the combo portion of the score.
2017-03-21 20:36:05 +08:00
/// For the accuracy portion of the score (including accuracy percentage), see <see cref="NumericResultForAccuracy(TaikoHitResult)"/>.
2017-03-17 16:06:34 +08:00
/// </summary>
/// <param name="result">The result to compute the value for.</param>
/// <returns>The numeric result value.</returns>
2017-03-21 20:36:05 +08:00
protected virtual int NumericResultForScore(TaikoHitResult result)
2017-03-17 16:06:34 +08:00
{
switch (result)
{
default:
return 0;
2017-03-21 20:36:05 +08:00
case TaikoHitResult.Good:
2017-03-17 16:06:34 +08:00
return 100;
2017-03-21 20:36:05 +08:00
case TaikoHitResult.Great:
2017-03-17 16:06:34 +08:00
return 300;
}
}
/// <summary>
/// Computes the numeric result value for the accuracy portion of the score.
2017-03-21 20:36:05 +08:00
/// For the combo portion of the score, see <see cref="NumericResultForScore(TaikoHitResult)"/>.
2017-03-17 16:06:34 +08:00
/// </summary>
/// <param name="result">The result to compute the value for.</param>
/// <returns>The numeric result value.</returns>
2017-03-21 20:36:05 +08:00
protected virtual int NumericResultForAccuracy(TaikoHitResult result)
2017-03-17 16:06:34 +08:00
{
switch (result)
{
default:
return 0;
2017-03-21 20:36:05 +08:00
case TaikoHitResult.Good:
2017-03-17 16:06:34 +08:00
return 150;
2017-03-21 20:36:05 +08:00
case TaikoHitResult.Great:
2017-03-17 16:06:34 +08:00
return 300;
}
}
}
}