Skip to content

Commit

Permalink
Merge pull request #545 from smoogipooo/taiko_scoreprocessing
Browse files Browse the repository at this point in the history
Taiko scoreprocessing
  • Loading branch information
peppy authored Mar 24, 2017
2 parents f233725 + cb0c7dc commit 6c3061e
Show file tree
Hide file tree
Showing 45 changed files with 369 additions and 90 deletions.
2 changes: 1 addition & 1 deletion osu.Desktop.VisualTests/Tests/TestCaseLeaderboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Screens.Testing;
using osu.Game.Modes;
using osu.Game.Modes.Mods;
using osu.Game.Modes.Osu.Mods;
using osu.Game.Modes.Scoring;
using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Users;

Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Modes.Catch/CatchRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using osu.Game.Modes.UI;
using osu.Game.Screens.Play;
using System.Collections.Generic;
using osu.Game.Modes.Catch.Scoring;
using osu.Game.Modes.Scoring;

namespace osu.Game.Modes.Catch
{
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Modes.Catch/Judgements/CatchJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace osu.Game.Modes.Catch.Judgements
{
public class CatchJudgement : Judgement
{
public override string ScoreString => string.Empty;
public override string ResultString => string.Empty;

public override string MaxScoreString => string.Empty;
public override string MaxResultString => string.Empty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

using osu.Game.Modes.Catch.Judgements;
using osu.Game.Modes.Catch.Objects;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Catch
namespace osu.Game.Modes.Catch.Scoring
{
internal class CatchScoreProcessor : ScoreProcessor<CatchBaseHit, CatchJudgement>
{
Expand All @@ -18,7 +19,7 @@ public CatchScoreProcessor(HitRenderer<CatchBaseHit, CatchJudgement> hitRenderer
{
}

protected override void UpdateCalculations(CatchJudgement newJudgement)
protected override void OnNewJugement(CatchJudgement judgement)
{
}
}
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Modes.Catch/UI/CatchHitRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
using osu.Game.Modes.Catch.Beatmaps;
using osu.Game.Modes.Catch.Judgements;
using osu.Game.Modes.Catch.Objects;
using osu.Game.Modes.Catch.Scoring;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Catch.UI
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Modes.Catch/osu.Game.Modes.Catch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<Compile Include="Beatmaps\CatchBeatmapConverter.cs" />
<Compile Include="Beatmaps\CatchBeatmapProcessor.cs" />
<Compile Include="CatchDifficultyCalculator.cs" />
<Compile Include="CatchScoreProcessor.cs" />
<Compile Include="Scoring\CatchScoreProcessor.cs" />
<Compile Include="Judgements\CatchJudgement.cs" />
<Compile Include="Objects\CatchBaseHit.cs" />
<Compile Include="Objects\Drawable\DrawableFruit.cs" />
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Modes.Mania/Judgements/ManiaJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace osu.Game.Modes.Mania.Judgements
{
public class ManiaJudgement : Judgement
{
public override string ScoreString => string.Empty;
public override string ResultString => string.Empty;

public override string MaxScoreString => string.Empty;
public override string MaxResultString => string.Empty;
}
}
2 changes: 2 additions & 0 deletions osu.Game.Modes.Mania/ManiaRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using osu.Game.Modes.UI;
using osu.Game.Screens.Play;
using System.Collections.Generic;
using osu.Game.Modes.Mania.Scoring;
using osu.Game.Modes.Scoring;

namespace osu.Game.Modes.Mania
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

using osu.Game.Modes.Mania.Judgements;
using osu.Game.Modes.Mania.Objects;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Mania
namespace osu.Game.Modes.Mania.Scoring
{
internal class ManiaScoreProcessor : ScoreProcessor<ManiaBaseHit, ManiaJudgement>
{
Expand All @@ -18,7 +19,7 @@ public ManiaScoreProcessor(HitRenderer<ManiaBaseHit, ManiaJudgement> hitRenderer
{
}

protected override void UpdateCalculations(ManiaJudgement newJudgement)
protected override void OnNewJugement(ManiaJudgement judgement)
{
}
}
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Modes.Mania/UI/ManiaHitRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
using osu.Game.Modes.Mania.Beatmaps;
using osu.Game.Modes.Mania.Judgements;
using osu.Game.Modes.Mania.Objects;
using osu.Game.Modes.Mania.Scoring;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Mania.UI
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Modes.Mania/osu.Game.Modes.Mania.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<Compile Include="Beatmaps\ManiaBeatmapProcessor.cs" />
<Compile Include="Judgements\ManiaJudgement.cs" />
<Compile Include="ManiaDifficultyCalculator.cs" />
<Compile Include="ManiaScoreProcessor.cs" />
<Compile Include="Scoring\ManiaScoreProcessor.cs" />
<Compile Include="Objects\Drawable\DrawableNote.cs" />
<Compile Include="Objects\HoldNote.cs" />
<Compile Include="Objects\ManiaBaseHit.cs" />
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Modes.Osu/Judgements/OsuJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class OsuJudgement : Judgement
/// </summary>
public OsuScoreResult MaxScore = OsuScoreResult.Hit300;

public override string ScoreString => Score.GetDescription();
public override string ResultString => Score.GetDescription();

public override string MaxScoreString => MaxScore.GetDescription();
public override string MaxResultString => MaxScore.GetDescription();

public int ScoreValue => scoreToInt(Score);

Expand Down
1 change: 1 addition & 0 deletions osu.Game.Modes.Osu/Mods/OsuMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using osu.Game.Modes.Osu.Objects;
using System;
using System.Linq;
using osu.Game.Modes.Scoring;

namespace osu.Game.Modes.Osu.Mods
{
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Modes.Osu/OsuRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
using osu.Game.Screens.Play;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Modes.Osu.Scoring;
using osu.Game.Modes.Scoring;

namespace osu.Game.Modes.Osu
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE

namespace osu.Game.Modes.Osu
using osu.Game.Modes.Scoring;

namespace osu.Game.Modes.Osu.Scoring
{
internal class OsuScore : Score
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Osu.Judgements;
using osu.Game.Modes.Osu.Objects;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;

namespace osu.Game.Modes.Osu
namespace osu.Game.Modes.Osu.Scoring
{
internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject, OsuJudgement>
{
Expand All @@ -27,7 +28,7 @@ protected override void Reset()
Accuracy.Value = 1;
}

protected override void UpdateCalculations(OsuJudgement judgement)
protected override void OnNewJugement(OsuJudgement judgement)
{
if (judgement != null)
{
Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Modes.Osu/UI/OsuHitRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using osu.Game.Modes.Osu.Judgements;
using osu.Game.Modes.Osu.Objects;
using osu.Game.Modes.Osu.Objects.Drawables;
using osu.Game.Modes.Osu.Scoring;
using osu.Game.Modes.Scoring;
using osu.Game.Modes.UI;
using osu.Game.Screens.Play;

Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
<Compile Include="OsuAutoReplay.cs" />
<Compile Include="OsuDifficultyCalculator.cs" />
<Compile Include="OsuKeyConversionInputManager.cs" />
<Compile Include="OsuScore.cs" />
<Compile Include="OsuScoreProcessor.cs" />
<Compile Include="Scoring\OsuScore.cs" />
<Compile Include="Scoring\OsuScoreProcessor.cs" />
<Compile Include="UI\OsuHitRenderer.cs" />
<Compile Include="UI\OsuPlayfield.cs" />
<Compile Include="OsuRuleset.cs" />
Expand Down
6 changes: 6 additions & 0 deletions osu.Game.Modes.Taiko/Beatmaps/TaikoBeatmapConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Legacy;
using osu.Game.Beatmaps.Samples;
using osu.Game.Modes.Objects;
using osu.Game.Modes.Objects.Types;
using osu.Game.Modes.Taiko.Objects;
Expand Down Expand Up @@ -43,12 +44,15 @@ private TaikoHitObject convertHitObject(HitObject original)
IHasRepeats repeatsData = original as IHasRepeats;
IHasEndTime endTimeData = original as IHasEndTime;

bool accented = ((original.Sample?.Type ?? SampleType.None) & SampleType.Finish) > 0;

if (distanceData != null)
{
return new DrumRoll
{
StartTime = original.StartTime,
Sample = original.Sample,
Accented = accented,

Distance = distanceData.Distance * (repeatsData?.RepeatCount ?? 1)
};
Expand All @@ -61,6 +65,7 @@ private TaikoHitObject convertHitObject(HitObject original)
{
StartTime = original.StartTime,
Sample = original.Sample,
Accented = accented,

EndTime = original.StartTime + endTimeData.Duration * bash_convert_factor
};
Expand All @@ -70,6 +75,7 @@ private TaikoHitObject convertHitObject(HitObject original)
{
StartTime = original.StartTime,
Sample = original.Sample,
Accented = accented
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions osu.Game.Modes.Taiko/Judgements/TaikoDrumRollTickJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ public class TaikoDrumRollTickJudgement : TaikoJudgement
/// <summary>
/// Drum roll ticks don't display judgement text.
/// </summary>
public override string ScoreString => string.Empty;
public override string ResultString => string.Empty;

/// <summary>
/// Drum roll ticks don't display judgement text.
/// </summary>
public override string MaxScoreString => string.Empty;
public override string MaxResultString => string.Empty;

protected override int NumericResultForScore(TaikoHitResult result)
{
Expand Down
36 changes: 18 additions & 18 deletions osu.Game.Modes.Taiko/Judgements/TaikoJudgement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,50 @@ namespace osu.Game.Modes.Taiko.Judgements
public class TaikoJudgement : Judgement
{
/// <summary>
/// The maximum score value.
/// The maximum result.
/// </summary>
public const TaikoHitResult MAX_HIT_RESULT = TaikoHitResult.Great;

/// <summary>
/// The score value.
/// The result.
/// </summary>
public TaikoHitResult TaikoResult;

/// <summary>
/// The score value for the combo portion of the score.
/// The result value for the combo portion of the score.
/// </summary>
public int ScoreValue => NumericResultForScore(TaikoResult);
public int ResultValueForScore => NumericResultForScore(TaikoResult);

/// <summary>
/// The score value for the accuracy portion of the score.
/// The result value for the accuracy portion of the score.
/// </summary>
public int AccuracyScoreValue => NumericResultForAccuracy(TaikoResult);
public int ResultValueForAccuracy => NumericResultForAccuracy(TaikoResult);

/// <summary>
/// The maximum score value for the combo portion of the score.
/// The maximum result value for the combo portion of the score.
/// </summary>
public int MaxScoreValue => NumericResultForScore(MAX_HIT_RESULT);
public int MaxResultValueForScore => NumericResultForScore(MAX_HIT_RESULT);

/// <summary>
/// The maximum score value for the accuracy portion of the score.
/// The maximum result value for the accuracy portion of the score.
/// </summary>
public int MaxAccuracyScoreValue => NumericResultForAccuracy(MAX_HIT_RESULT);
public int MaxResultValueForAccuracy => NumericResultForAccuracy(MAX_HIT_RESULT);

public override string ScoreString => TaikoResult.GetDescription();
public override string ResultString => TaikoResult.GetDescription();

public override string MaxScoreString => MAX_HIT_RESULT.GetDescription();
public override string MaxResultString => MAX_HIT_RESULT.GetDescription();

/// <summary>
/// Whether this Judgement has a secondary hit in the case of finishers.
/// </summary>
public bool SecondHit;

/// <summary>
/// Computes the numeric score value for the combo portion of the score.
/// Computes the numeric result value for the combo portion of the score.
/// For the accuracy portion of the score (including accuracy percentage), see <see cref="NumericResultForAccuracy(TaikoHitResult)"/>.
/// </summary>
/// <param name="result">The result to compute the score value for.</param>
/// <returns>The numeric score value.</returns>
/// <param name="result">The result to compute the value for.</param>
/// <returns>The numeric result value.</returns>
protected virtual int NumericResultForScore(TaikoHitResult result)
{
switch (result)
Expand All @@ -67,11 +67,11 @@ protected virtual int NumericResultForScore(TaikoHitResult result)
}

/// <summary>
/// Computes the numeric score value for the accuracy portion of the score.
/// Computes the numeric result value for the accuracy portion of the score.
/// For the combo portion of the score, see <see cref="NumericResultForScore(TaikoHitResult)"/>.
/// </summary>
/// <param name="result">The result to compute the score value for.</param>
/// <returns>The numeric score value.</returns>
/// <param name="result">The result to compute the value for.</param>
/// <returns>The numeric result value.</returns>
protected virtual int NumericResultForAccuracy(TaikoHitResult result)
{
switch (result)
Expand Down
6 changes: 6 additions & 0 deletions osu.Game.Modes.Taiko/Objects/TaikoHitObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public abstract class TaikoHitObject : HitObject
/// </summary>
public double PreEmpt;

/// <summary>
/// Whether this HitObject is accented.
/// Accented hit objects give more points for hitting the hit object with both keys.
/// </summary>
public bool Accented;

/// <summary>
/// Whether this HitObject is in Kiai time.
/// </summary>
Expand Down
Loading

0 comments on commit 6c3061e

Please sign in to comment.