From e0e0a2726d475898a226dd0f2da0f60c44240526 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 15 Mar 2017 19:23:42 +0900 Subject: [PATCH] Move OsuJudgementInfo to its own class, remove PositionalJudgementInfo. --- .../Tests/TestCaseHitObjects.cs | 1 + .../Judgements/OsuJudgementInfo.cs | 47 +++++++++++++++++++ .../Objects/Drawables/DrawableOsuHitObject.cs | 37 +-------------- .../Objects/Drawables/DrawableSliderTick.cs | 1 + .../Objects/Drawables/HitExplosion.cs | 1 + osu.Game.Modes.Osu/OsuScoreProcessor.cs | 2 +- osu.Game.Modes.Osu/UI/OsuHitRenderer.cs | 1 + osu.Game.Modes.Osu/UI/OsuPlayfield.cs | 1 + osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj | 1 + .../Objects/Drawables/DrawableHitObject.cs | 6 --- 10 files changed, 55 insertions(+), 43 deletions(-) create mode 100644 osu.Game.Modes.Osu/Judgements/OsuJudgementInfo.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index 01c10489d7..b5c7ddeb27 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -13,6 +13,7 @@ using osu.Game.Modes.Osu.Objects.Drawables; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; +using osu.Game.Modes.Osu.Judgements; using OpenTK.Graphics; namespace osu.Desktop.VisualTests.Tests diff --git a/osu.Game.Modes.Osu/Judgements/OsuJudgementInfo.cs b/osu.Game.Modes.Osu/Judgements/OsuJudgementInfo.cs new file mode 100644 index 0000000000..9cbb8bfd1c --- /dev/null +++ b/osu.Game.Modes.Osu/Judgements/OsuJudgementInfo.cs @@ -0,0 +1,47 @@ +using OpenTK; +using osu.Game.Modes.Judgements; +using osu.Game.Modes.Osu.Objects.Drawables; + +namespace osu.Game.Modes.Osu.Judgements +{ + public class OsuJudgementInfo : JudgementInfo + { + /// + /// The positional hit offset. + /// + public Vector2 PositionOffset; + + /// + /// The score the user achieved. + /// + public OsuScoreResult Score; + + /// + /// The score which would be achievable on a perfect hit. + /// + public OsuScoreResult MaxScore = OsuScoreResult.Hit300; + + public int ScoreValue => scoreToInt(Score); + + public int MaxScoreValue => scoreToInt(MaxScore); + + private int scoreToInt(OsuScoreResult result) + { + switch (result) + { + default: + return 0; + case OsuScoreResult.Hit50: + return 50; + case OsuScoreResult.Hit100: + return 100; + case OsuScoreResult.Hit300: + return 300; + case OsuScoreResult.SliderTick: + return 10; + } + } + + public ComboResult Combo; + } +} \ No newline at end of file diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs index b9003a3207..5e6249d66f 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableOsuHitObject.cs @@ -3,6 +3,7 @@ using System.ComponentModel; using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Osu.Judgements; namespace osu.Game.Modes.Osu.Objects.Drawables { @@ -45,42 +46,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables } } - public class OsuJudgementInfo : PositionalJudgementInfo - { - /// - /// The score the user achieved. - /// - public OsuScoreResult Score; - - /// - /// The score which would be achievable on a perfect hit. - /// - public OsuScoreResult MaxScore = OsuScoreResult.Hit300; - - public int ScoreValue => scoreToInt(Score); - - public int MaxScoreValue => scoreToInt(MaxScore); - - private int scoreToInt(OsuScoreResult result) - { - switch (result) - { - default: - return 0; - case OsuScoreResult.Hit50: - return 50; - case OsuScoreResult.Hit100: - return 100; - case OsuScoreResult.Hit300: - return 300; - case OsuScoreResult.SliderTick: - return 10; - } - } - - public ComboResult Combo; - } - public enum ComboResult { [Description(@"")] diff --git a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs index 87d0babef2..4ef4d18bfc 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/DrawableSliderTick.cs @@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; using osu.Game.Beatmaps.Samples; using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Osu.Judgements; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs index 39a7862db6..ab34d49ecf 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; using osu.Game.Graphics.Sprites; using osu.Game.Modes.Objects.Drawables; +using osu.Game.Modes.Osu.Judgements; using OpenTK; using OpenTK.Graphics; diff --git a/osu.Game.Modes.Osu/OsuScoreProcessor.cs b/osu.Game.Modes.Osu/OsuScoreProcessor.cs index 2377e2f520..425c454dc7 100644 --- a/osu.Game.Modes.Osu/OsuScoreProcessor.cs +++ b/osu.Game.Modes.Osu/OsuScoreProcessor.cs @@ -3,7 +3,7 @@ using osu.Game.Modes.Judgements; using osu.Game.Modes.Objects.Drawables; -using osu.Game.Modes.Osu.Objects.Drawables; +using osu.Game.Modes.Osu.Judgements; namespace osu.Game.Modes.Osu { diff --git a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs index c5d729e76f..0169e9a0e6 100644 --- a/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs +++ b/osu.Game.Modes.Osu/UI/OsuHitRenderer.cs @@ -4,6 +4,7 @@ using osu.Game.Beatmaps; using osu.Game.Modes.Objects.Drawables; using osu.Game.Modes.Osu.Beatmaps; +using osu.Game.Modes.Osu.Judgements; using osu.Game.Modes.Osu.Objects; using osu.Game.Modes.Osu.Objects.Drawables; using osu.Game.Modes.UI; diff --git a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs index dd023b1cc1..7f7ec2d161 100644 --- a/osu.Game.Modes.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Modes.Osu/UI/OsuPlayfield.cs @@ -11,6 +11,7 @@ using osu.Game.Modes.Osu.Objects.Drawables.Connections; using osu.Game.Modes.UI; using System.Linq; using osu.Game.Graphics.Cursor; +using osu.Game.Modes.Osu.Judgements; using OpenTK.Graphics; namespace osu.Game.Modes.Osu.UI diff --git a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj index f2c6efd8bd..91ca01c4c8 100644 --- a/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj +++ b/osu.Game.Modes.Osu/osu.Game.Modes.Osu.csproj @@ -49,6 +49,7 @@ + diff --git a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs index 2963c84493..fd728706cb 100644 --- a/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Modes/Objects/Drawables/DrawableHitObject.cs @@ -9,7 +9,6 @@ using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Game.Beatmaps.Samples; using osu.Game.Modes.Judgements; -using OpenTK; using Container = osu.Framework.Graphics.Containers.Container; namespace osu.Game.Modes.Objects.Drawables @@ -153,9 +152,4 @@ namespace osu.Game.Modes.Objects.Drawables nestedHitObjects.Add(h); } } - - public class PositionalJudgementInfo : JudgementInfo - { - public Vector2 PositionOffset; - } }