mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 08:12:53 +08:00
Basic score flow.
This commit is contained in:
parent
bb37e5d955
commit
9871960112
@ -17,6 +17,8 @@ namespace osu.Game.Modes.Osu
|
|||||||
|
|
||||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||||
|
|
||||||
|
public override Score CreateScore() => new OsuScore();
|
||||||
|
|
||||||
protected override PlayMode PlayMode => PlayMode.Osu;
|
protected override PlayMode PlayMode => PlayMode.Osu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
osu.Game.Mode.Osu/OsuScore.cs
Normal file
12
osu.Game.Mode.Osu/OsuScore.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes.Osu
|
||||||
|
{
|
||||||
|
class OsuScore : Score
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -53,6 +53,7 @@
|
|||||||
<Compile Include="Objects\Drawables\Pieces\RingPiece.cs" />
|
<Compile Include="Objects\Drawables\Pieces\RingPiece.cs" />
|
||||||
<Compile Include="Objects\Drawables\Pieces\Triangles.cs" />
|
<Compile Include="Objects\Drawables\Pieces\Triangles.cs" />
|
||||||
<Compile Include="Objects\OsuHitObjectParser.cs" />
|
<Compile Include="Objects\OsuHitObjectParser.cs" />
|
||||||
|
<Compile Include="OsuScore.cs" />
|
||||||
<Compile Include="UI\OsuComboCounter.cs" />
|
<Compile Include="UI\OsuComboCounter.cs" />
|
||||||
<Compile Include="UI\OsuHitRenderer.cs" />
|
<Compile Include="UI\OsuHitRenderer.cs" />
|
||||||
<Compile Include="UI\OsuPlayfield.cs" />
|
<Compile Include="UI\OsuPlayfield.cs" />
|
||||||
|
@ -18,6 +18,8 @@ namespace osu.Game.Modes.Catch
|
|||||||
|
|
||||||
protected override PlayMode PlayMode => PlayMode.Catch;
|
protected override PlayMode PlayMode => PlayMode.Catch;
|
||||||
|
|
||||||
|
public override Score CreateScore() => new Score();
|
||||||
|
|
||||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@ namespace osu.Game.Modes.Mania
|
|||||||
|
|
||||||
protected override PlayMode PlayMode => PlayMode.Mania;
|
protected override PlayMode PlayMode => PlayMode.Mania;
|
||||||
|
|
||||||
|
public override Score CreateScore() => new Score();
|
||||||
|
|
||||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Game.Modes.Objects;
|
using osu.Game.Modes.Objects;
|
||||||
using osu.Game.Modes.Osu.Objects;
|
using osu.Game.Modes.Osu.Objects;
|
||||||
@ -18,6 +19,8 @@ namespace osu.Game.Modes.Taiko
|
|||||||
|
|
||||||
protected override PlayMode PlayMode => PlayMode.Taiko;
|
protected override PlayMode PlayMode => PlayMode.Taiko;
|
||||||
|
|
||||||
|
public override Score CreateScore() => new Score();
|
||||||
|
|
||||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,8 @@ namespace osu.Game.Modes
|
|||||||
|
|
||||||
public abstract ScoreOverlay CreateScoreOverlay();
|
public abstract ScoreOverlay CreateScoreOverlay();
|
||||||
|
|
||||||
|
public abstract Score CreateScore();
|
||||||
|
|
||||||
public abstract HitRenderer CreateHitRendererWith(List<HitObject> objects);
|
public abstract HitRenderer CreateHitRendererWith(List<HitObject> objects);
|
||||||
|
|
||||||
public abstract HitObjectParser CreateHitObjectParser();
|
public abstract HitObjectParser CreateHitObjectParser();
|
||||||
|
17
osu.Game/Modes/Score.cs
Normal file
17
osu.Game/Modes/Score.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace osu.Game.Modes
|
||||||
|
{
|
||||||
|
public class Score
|
||||||
|
{
|
||||||
|
public double TotalScore { get; }
|
||||||
|
public double Accuracy { get; }
|
||||||
|
}
|
||||||
|
}
|
@ -15,6 +15,7 @@ namespace osu.Game.Modes.UI
|
|||||||
public ComboCounter ComboCounter;
|
public ComboCounter ComboCounter;
|
||||||
public ScoreCounter ScoreCounter;
|
public ScoreCounter ScoreCounter;
|
||||||
public PercentageCounter AccuracyCounter;
|
public PercentageCounter AccuracyCounter;
|
||||||
|
public Score Score { get; set; }
|
||||||
|
|
||||||
protected abstract KeyCounterCollection CreateKeyCounter();
|
protected abstract KeyCounterCollection CreateKeyCounter();
|
||||||
protected abstract ComboCounter CreateComboCounter();
|
protected abstract ComboCounter CreateComboCounter();
|
||||||
|
@ -19,6 +19,7 @@ using OpenTK.Input;
|
|||||||
using MouseState = osu.Framework.Input.MouseState;
|
using MouseState = osu.Framework.Input.MouseState;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.GameModes;
|
using osu.Framework.GameModes;
|
||||||
|
using osu.Game.Screens.Ranking;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -36,6 +37,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private IAdjustableClock sourceClock;
|
private IAdjustableClock sourceClock;
|
||||||
|
|
||||||
|
private Score score;
|
||||||
|
|
||||||
private Ruleset ruleset;
|
private Ruleset ruleset;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -84,6 +87,8 @@ namespace osu.Game.Screens.Play
|
|||||||
ruleset = Ruleset.GetRuleset(usablePlayMode);
|
ruleset = Ruleset.GetRuleset(usablePlayMode);
|
||||||
|
|
||||||
var scoreOverlay = ruleset.CreateScoreOverlay();
|
var scoreOverlay = ruleset.CreateScoreOverlay();
|
||||||
|
scoreOverlay.Score = (score = ruleset.CreateScore());
|
||||||
|
|
||||||
var hitRenderer = ruleset.CreateHitRendererWith(beatmap.HitObjects);
|
var hitRenderer = ruleset.CreateHitRendererWith(beatmap.HitObjects);
|
||||||
|
|
||||||
hitRenderer.OnHit += delegate (HitObject h) { scoreOverlay.OnHit(h); };
|
hitRenderer.OnHit += delegate (HitObject h) { scoreOverlay.OnHit(h); };
|
||||||
@ -117,6 +122,12 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
Clock.ProcessFrame();
|
Clock.ProcessFrame();
|
||||||
|
|
||||||
|
if (Beatmap.Track.HasCompleted)
|
||||||
|
Push(new Results
|
||||||
|
{
|
||||||
|
Score = score
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class PlayerInputManager : UserInputManager
|
class PlayerInputManager : UserInputManager
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.GameModes;
|
using osu.Framework.GameModes;
|
||||||
|
using osu.Game.Modes;
|
||||||
using osu.Game.Screens.Backgrounds;
|
using osu.Game.Screens.Backgrounds;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
@ -22,5 +23,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
Background.Schedule(() => Background.FadeColour(Color4.White, 500));
|
Background.Schedule(() => Background.FadeColour(Color4.White, 500));
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Score Score { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,7 @@
|
|||||||
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
|
<Compile Include="Beatmaps\Drawables\BeatmapBackgroundSprite.cs" />
|
||||||
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
||||||
<Compile Include="Modes\Objects\HitObjectParser.cs" />
|
<Compile Include="Modes\Objects\HitObjectParser.cs" />
|
||||||
|
<Compile Include="Modes\Score.cs" />
|
||||||
<Compile Include="Overlays\DragBar.cs" />
|
<Compile Include="Overlays\DragBar.cs" />
|
||||||
<Compile Include="Overlays\MusicController.cs" />
|
<Compile Include="Overlays\MusicController.cs" />
|
||||||
<Compile Include="Beatmaps\Beatmap.cs" />
|
<Compile Include="Beatmaps\Beatmap.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user