1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-18 05:43:21 +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 score value.
/// </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 score value.
/// </summary>
2017-03-21 20:36:05 +08:00
public TaikoHitResult TaikoResult;
2017-03-17 16:06:34 +08:00
/// <summary>
/// The score value for the combo portion of the score.
/// </summary>
2017-03-21 20:36:05 +08:00
public int ScoreValue => NumericResultForScore(TaikoResult);
2017-03-17 16:06:34 +08:00
/// <summary>
/// The score value for the accuracy portion of the score.
/// </summary>
2017-03-21 20:36:05 +08:00
public int AccuracyScoreValue => NumericResultForAccuracy(TaikoResult);
2017-03-17 16:06:34 +08:00
/// <summary>
/// The maximum score value for the combo portion of the score.
/// </summary>
2017-03-21 20:38:39 +08:00
public int MaxScoreValue => NumericResultForScore(MAX_HIT_RESULT);
2017-03-17 16:06:34 +08:00
/// <summary>
/// The maximum score value for the accuracy portion of the score.
/// </summary>
2017-03-21 20:38:39 +08:00
public int MaxAccuracyScoreValue => NumericResultForAccuracy(MAX_HIT_RESULT);
2017-03-17 16:06:34 +08:00
public override string ScoreString => TaikoResult.GetDescription();
public override string MaxScoreString => MAX_HIT_RESULT.GetDescription();
2017-03-17 16:06:34 +08:00
/// <summary>
/// Whether this Judgement has a secondary hit in the case of finishers.
/// </summary>
public bool SecondHit;
/// <summary>
2017-03-21 20:36:05 +08:00
/// Computes the numeric score value for the combo portion of the score.
/// 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 score value for.</param>
2017-03-21 20:36:05 +08:00
/// <returns>The numeric score value.</returns>
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>
2017-03-21 20:36:05 +08:00
/// Computes the numeric score value for the accuracy portion of the score.
/// 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 score value for.</param>
2017-03-21 20:36:05 +08:00
/// <returns>The numeric score value.</returns>
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;
}
}
}
}