mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 13:37:25 +08:00
Add concept of ScoreProcessor.
This commit is contained in:
parent
9871960112
commit
9d2a69f1e2
@ -17,7 +17,7 @@ namespace osu.Game.Modes.Osu
|
||||
|
||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||
|
||||
public override Score CreateScore() => new OsuScore();
|
||||
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor();
|
||||
|
||||
protected override PlayMode PlayMode => PlayMode.Osu;
|
||||
}
|
||||
|
12
osu.Game.Mode.Osu/OsuScoreProcessor.cs
Normal file
12
osu.Game.Mode.Osu/OsuScoreProcessor.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 OsuScoreProcessor : ScoreProcessor
|
||||
{
|
||||
}
|
||||
}
|
@ -54,6 +54,7 @@
|
||||
<Compile Include="Objects\Drawables\Pieces\Triangles.cs" />
|
||||
<Compile Include="Objects\OsuHitObjectParser.cs" />
|
||||
<Compile Include="OsuScore.cs" />
|
||||
<Compile Include="OsuScoreProcessor.cs" />
|
||||
<Compile Include="UI\OsuComboCounter.cs" />
|
||||
<Compile Include="UI\OsuHitRenderer.cs" />
|
||||
<Compile Include="UI\OsuPlayfield.cs" />
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Modes.Catch
|
||||
|
||||
protected override PlayMode PlayMode => PlayMode.Catch;
|
||||
|
||||
public override Score CreateScore() => new Score();
|
||||
public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor();
|
||||
|
||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Modes.Mania
|
||||
|
||||
protected override PlayMode PlayMode => PlayMode.Mania;
|
||||
|
||||
public override Score CreateScore() => new Score();
|
||||
public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor();
|
||||
|
||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Modes.Taiko
|
||||
|
||||
protected override PlayMode PlayMode => PlayMode.Taiko;
|
||||
|
||||
public override Score CreateScore() => new Score();
|
||||
public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor();
|
||||
|
||||
public override HitObjectParser CreateHitObjectParser() => new OsuHitObjectParser();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Modes
|
||||
|
||||
public abstract ScoreOverlay CreateScoreOverlay();
|
||||
|
||||
public abstract Score CreateScore();
|
||||
public abstract ScoreProcessor CreateScoreProcessor();
|
||||
|
||||
public abstract HitRenderer CreateHitRendererWith(List<HitObject> objects);
|
||||
|
||||
|
16
osu.Game/Modes/ScoreProcesssor.cs
Normal file
16
osu.Game/Modes/ScoreProcesssor.cs
Normal file
@ -0,0 +1,16 @@
|
||||
//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 ScoreProcessor
|
||||
{
|
||||
public virtual Score GetScore() => new Score();
|
||||
}
|
||||
}
|
@ -46,5 +46,10 @@ namespace osu.Game.Modes.UI
|
||||
AccuracyCounter = CreateAccuracyCounter(),
|
||||
};
|
||||
}
|
||||
|
||||
public void BindProcessor(ScoreProcessor processor)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,10 +37,10 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private IAdjustableClock sourceClock;
|
||||
|
||||
private Score score;
|
||||
|
||||
private Ruleset ruleset;
|
||||
|
||||
private ScoreProcessor scoreProcessor;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game)
|
||||
{
|
||||
@ -87,7 +87,7 @@ namespace osu.Game.Screens.Play
|
||||
ruleset = Ruleset.GetRuleset(usablePlayMode);
|
||||
|
||||
var scoreOverlay = ruleset.CreateScoreOverlay();
|
||||
scoreOverlay.Score = (score = ruleset.CreateScore());
|
||||
scoreOverlay.BindProcessor(scoreProcessor = ruleset.CreateScoreProcessor());
|
||||
|
||||
var hitRenderer = ruleset.CreateHitRendererWith(beatmap.HitObjects);
|
||||
|
||||
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Play
|
||||
if (Beatmap.Track.HasCompleted)
|
||||
Push(new Results
|
||||
{
|
||||
Score = score
|
||||
Score = scoreProcessor.GetScore()
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,7 @@
|
||||
<Compile Include="Graphics\Cursor\CursorTrail.cs" />
|
||||
<Compile Include="Modes\Objects\HitObjectParser.cs" />
|
||||
<Compile Include="Modes\Score.cs" />
|
||||
<Compile Include="Modes\ScoreProcesssor.cs" />
|
||||
<Compile Include="Overlays\DragBar.cs" />
|
||||
<Compile Include="Overlays\MusicController.cs" />
|
||||
<Compile Include="Beatmaps\Beatmap.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user