1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 14:07:25 +08:00

Add a way to get the score string from JugementInfo.

This commit is contained in:
smoogipooo 2017-03-23 12:21:09 +09:00
parent 2c580f43e9
commit 8b71d70633
6 changed files with 43 additions and 2 deletions

View File

@ -7,5 +7,8 @@ namespace osu.Game.Modes.Catch.Judgements
{
public class CatchJudgementInfo : JudgementInfo
{
public override string ScoreString => string.Empty;
public override string MaxScoreString => string.Empty;
}
}

View File

@ -7,5 +7,8 @@ namespace osu.Game.Modes.Mania.Judgements
{
public class ManiaJudgementInfo : JudgementInfo
{
public override string ScoreString => string.Empty;
public override string MaxScoreString => string.Empty;
}
}

View File

@ -4,6 +4,7 @@
using OpenTK;
using osu.Game.Modes.Judgements;
using osu.Game.Modes.Osu.Objects.Drawables;
using osu.Framework.Extensions;
namespace osu.Game.Modes.Osu.Judgements
{
@ -24,6 +25,10 @@ namespace osu.Game.Modes.Osu.Judgements
/// </summary>
public OsuScoreResult MaxScore = OsuScoreResult.Hit300;
public override string ScoreString => Score.GetDescription();
public override string MaxScoreString => MaxScore.GetDescription();
public int ScoreValue => scoreToInt(Score);
public int MaxScoreValue => scoreToInt(MaxScore);

View File

@ -1,11 +1,15 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.ComponentModel;
namespace osu.Game.Modes.Taiko.Judgements
{
public enum TaikoHitResult
{
[Description("GOOD")]
Good,
[Description("GREAT")]
Great
}
}

View File

@ -2,6 +2,7 @@
// 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
{
@ -37,6 +38,10 @@ namespace osu.Game.Modes.Taiko.Judgements
/// </summary>
public int MaxAccuracyScoreValue => NumericResultForAccuracy(MAX_HIT_RESULT);
public override string ScoreString => TaikoResult.GetDescription();
public override string MaxScoreString => MAX_HIT_RESULT.GetDescription();
/// <summary>
/// Whether this Judgement has a secondary hit in the case of finishers.
/// </summary>

View File

@ -5,10 +5,31 @@ using osu.Game.Modes.Objects.Drawables;
namespace osu.Game.Modes.Judgements
{
public class JudgementInfo
public abstract class JudgementInfo
{
public ulong? ComboAtHit;
/// <summary>
/// Whether this judgement is the result of a hit or a miss.
/// </summary>
public HitResult? Result;
/// <summary>
/// The offset at which this judgement occurred.
/// </summary>
public double TimeOffset;
/// <summary>
/// The combo after this judgement was processed.
/// </summary>
public ulong? ComboAtHit;
/// <summary>
/// The string representation for the score achieved.
/// </summary>
public abstract string ScoreString { get; }
/// <summary>
/// The string representation for the max score achievable.
/// </summary>
public abstract string MaxScoreString { get; }
}
}