mirror of
https://github.com/ppy/osu.git
synced 2025-03-17 21:27:23 +08:00
Move OsuJudgementInfo to its own class, remove PositionalJudgementInfo.
This commit is contained in:
parent
a9bc253b8c
commit
e0e0a2726d
@ -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
|
||||
|
47
osu.Game.Modes.Osu/Judgements/OsuJudgementInfo.cs
Normal file
47
osu.Game.Modes.Osu/Judgements/OsuJudgementInfo.cs
Normal file
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// The positional hit offset.
|
||||
/// </summary>
|
||||
public Vector2 PositionOffset;
|
||||
|
||||
/// <summary>
|
||||
/// The score the user achieved.
|
||||
/// </summary>
|
||||
public OsuScoreResult Score;
|
||||
|
||||
/// <summary>
|
||||
/// The score which would be achievable on a perfect hit.
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// The score the user achieved.
|
||||
/// </summary>
|
||||
public OsuScoreResult Score;
|
||||
|
||||
/// <summary>
|
||||
/// The score which would be achievable on a perfect hit.
|
||||
/// </summary>
|
||||
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(@"")]
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -49,6 +49,7 @@
|
||||
<Compile Include="Objects\Drawables\DrawableOsuHitObject.cs" />
|
||||
<Compile Include="Objects\Drawables\Connections\ConnectionRenderer.cs" />
|
||||
<Compile Include="Objects\Drawables\Connections\FollowPointRenderer.cs" />
|
||||
<Compile Include="Judgements\OsuJudgementInfo.cs" />
|
||||
<Compile Include="Objects\Drawables\Pieces\ApproachCircle.cs" />
|
||||
<Compile Include="Objects\Drawables\Pieces\SpinnerBackground.cs" />
|
||||
<Compile Include="Objects\Drawables\Pieces\CirclePiece.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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user