1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 01:52:55 +08:00

Add concept of ScoreProcessor.

This commit is contained in:
Dean Herbert 2016-11-29 20:30:16 +09:00
parent 9871960112
commit 9d2a69f1e2
11 changed files with 44 additions and 9 deletions

View File

@ -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;
}

View 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
{
}
}

View File

@ -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" />

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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);

View 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();
}
}

View File

@ -46,5 +46,10 @@ namespace osu.Game.Modes.UI
AccuracyCounter = CreateAccuracyCounter(),
};
}
public void BindProcessor(ScoreProcessor processor)
{
}
}
}

View File

@ -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()
});
}

View File

@ -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" />