mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 03:25:11 +08:00
Remove mostly-unused Score parameter
This commit is contained in:
parent
c9c65cab53
commit
cf42d5bbd5
@ -5,7 +5,6 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Replays;
|
||||
using osu.Game.Rulesets.Replays.Legacy;
|
||||
using osu.Game.Rulesets.Replays.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Replays
|
||||
{
|
||||
@ -25,7 +24,7 @@ namespace osu.Game.Rulesets.Catch.Replays
|
||||
Dashing = dashing;
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Score score, Beatmap beatmap)
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
|
||||
{
|
||||
// Todo: This needs to be re-scaled
|
||||
X = legacyFrame.Position.X;
|
||||
|
@ -7,7 +7,6 @@ using osu.Game.Rulesets.Mania.Beatmaps;
|
||||
using osu.Game.Rulesets.Replays;
|
||||
using osu.Game.Rulesets.Replays.Legacy;
|
||||
using osu.Game.Rulesets.Replays.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Replays
|
||||
{
|
||||
@ -25,10 +24,10 @@ namespace osu.Game.Rulesets.Mania.Replays
|
||||
Actions.AddRange(actions);
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Score score, Beatmap beatmap)
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
|
||||
{
|
||||
// We don't need to fully convert, just create the converter
|
||||
var converter = new ManiaBeatmapConverter(beatmap.BeatmapInfo.Ruleset.Equals(score.Ruleset), beatmap);
|
||||
var converter = new ManiaBeatmapConverter(beatmap.BeatmapInfo.RulesetID == 3, beatmap);
|
||||
|
||||
// NB: Via co-op mod, osu-stable can have two stages with floor(col/2) and ceil(col/2) columns. This will need special handling
|
||||
// elsewhere in the game if we do choose to support the old co-op mod anyway. For now, assume that there is only one stage.
|
||||
|
@ -6,7 +6,6 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Replays;
|
||||
using osu.Game.Rulesets.Replays.Legacy;
|
||||
using osu.Game.Rulesets.Replays.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Replays
|
||||
@ -27,7 +26,7 @@ namespace osu.Game.Rulesets.Osu.Replays
|
||||
Actions.AddRange(actions);
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Score score, Beatmap beatmap)
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
|
||||
{
|
||||
Position = legacyFrame.Position;
|
||||
if (legacyFrame.MouseLeft) Actions.Add(OsuAction.LeftButton);
|
||||
|
@ -6,7 +6,6 @@ using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Replays;
|
||||
using osu.Game.Rulesets.Replays.Legacy;
|
||||
using osu.Game.Rulesets.Replays.Types;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Replays
|
||||
{
|
||||
@ -24,7 +23,7 @@ namespace osu.Game.Rulesets.Taiko.Replays
|
||||
Actions.AddRange(actions);
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Score score, Beatmap beatmap)
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
|
||||
{
|
||||
if (legacyFrame.MouseRight1) Actions.Add(TaikoAction.LeftRim);
|
||||
if (legacyFrame.MouseRight2) Actions.Add(TaikoAction.RightRim);
|
||||
|
@ -3,12 +3,20 @@
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Replays.Legacy;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
|
||||
namespace osu.Game.Rulesets.Replays.Types
|
||||
{
|
||||
/// <summary>
|
||||
/// A type of <see cref="ReplayFrame"/> which can be converted from a <see cref="LegacyReplayFrame"/>.
|
||||
/// </summary>
|
||||
public interface IConvertibleReplayFrame
|
||||
{
|
||||
void ConvertFrom(LegacyReplayFrame legacyFrame, Score score, Beatmap beatmap);
|
||||
/// <summary>
|
||||
/// Populates this <see cref="ReplayFrame"/> using values from a <see cref="LegacyReplayFrame"/>.
|
||||
/// </summary>
|
||||
/// <param name="legacyFrame">The <see cref="LegacyReplayFrame"/> to extract values from.</param>
|
||||
/// <param name="score">The score.</param>
|
||||
/// <param name="beatmap">The beatmap.</param>
|
||||
void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ namespace osu.Game.Rulesets.Scoring.Legacy
|
||||
}
|
||||
|
||||
private Beatmap currentBeatmap;
|
||||
private Score currentScore;
|
||||
private Ruleset currentRuleset;
|
||||
|
||||
public Score Parse(Stream stream)
|
||||
@ -33,7 +32,7 @@ namespace osu.Game.Rulesets.Scoring.Legacy
|
||||
|
||||
using (SerializationReader sr = new SerializationReader(stream))
|
||||
{
|
||||
currentScore = score = new Score { Ruleset = rulesets.GetRuleset(sr.ReadByte()) };
|
||||
score = new Score { Ruleset = rulesets.GetRuleset(sr.ReadByte()) };
|
||||
currentRuleset = score.Ruleset.CreateInstance();
|
||||
|
||||
/* score.Pass = true;*/
|
||||
@ -142,7 +141,7 @@ namespace osu.Game.Rulesets.Scoring.Legacy
|
||||
var convertible = currentRuleset.CreateConvertibleReplayFrame();
|
||||
if (convertible == null)
|
||||
throw new InvalidOperationException($"Legacy replay cannot be converted for the ruleset: {currentRuleset.Description}");
|
||||
convertible.ConvertFrom(legacyFrame, currentScore, currentBeatmap);
|
||||
convertible.ConvertFrom(legacyFrame, currentBeatmap);
|
||||
|
||||
return (ReplayFrame)convertible;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user