mirror of https://github.com/ppy/osu
Rename last remaining `BeatmapInfo Beatmap` usage
This commit is contained in:
parent
5937a93e2d
commit
853cf6feaa
|
@ -48,7 +48,7 @@ public void Setup() => Schedule(() =>
|
|||
{
|
||||
Position = new Vector2(100, 300),
|
||||
},
|
||||
accuracyHeatmap = new TestAccuracyHeatmap(new ScoreInfo { Beatmap = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo })
|
||||
accuracyHeatmap = new TestAccuracyHeatmap(new ScoreInfo { BeatmapInfo = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo })
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
|
|
@ -950,7 +950,7 @@ private static Task createScoreForBeatmap(OsuGameBase osu, BeatmapInfo beatmapIn
|
|||
return ImportScoreTest.LoadScoreIntoOsu(osu, new ScoreInfo
|
||||
{
|
||||
OnlineScoreID = 2,
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
BeatmapInfoID = beatmapInfo.ID
|
||||
}, new ImportScoreTest.TestArchiveReader());
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ public async Task TestImportWithDeletedBeatmapSet()
|
|||
var beatmapManager = osu.Dependencies.Get<BeatmapManager>();
|
||||
var scoreManager = osu.Dependencies.Get<ScoreManager>();
|
||||
|
||||
beatmapManager.Delete(beatmapManager.QueryBeatmapSet(s => s.Beatmaps.Any(b => b.ID == imported.Beatmap.ID)));
|
||||
beatmapManager.Delete(beatmapManager.QueryBeatmapSet(s => s.Beatmaps.Any(b => b.ID == imported.BeatmapInfo.ID)));
|
||||
Assert.That(scoreManager.Query(s => s.ID == imported.ID).DeletePending, Is.EqualTo(true));
|
||||
|
||||
var secondImport = await LoadScoreIntoOsu(osu, imported);
|
||||
|
@ -181,7 +181,7 @@ public static async Task<ScoreInfo> LoadScoreIntoOsu(OsuGameBase osu, ScoreInfo
|
|||
{
|
||||
var beatmapManager = osu.Dependencies.Get<BeatmapManager>();
|
||||
|
||||
score.Beatmap ??= beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First();
|
||||
score.BeatmapInfo ??= beatmapManager.GetAllUsableBeatmapSets().First().Beatmaps.First();
|
||||
score.Ruleset ??= new OsuRuleset().RulesetInfo;
|
||||
|
||||
var scoreManager = osu.Dependencies.Get<ScoreManager>();
|
||||
|
|
|
@ -232,7 +232,7 @@ public void TestTransition()
|
|||
AddStep("Transition to Results", () => player.Push(results = new FadeAccessibleResults(new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "osu!" },
|
||||
Beatmap = new TestBeatmap(Ruleset.Value).BeatmapInfo,
|
||||
BeatmapInfo = new TestBeatmap(Ruleset.Value).BeatmapInfo,
|
||||
Ruleset = Ruleset.Value,
|
||||
})));
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public void SetUp() => Schedule(() =>
|
|||
Recorder = recorder = new TestReplayRecorder(new Score
|
||||
{
|
||||
Replay = replay,
|
||||
ScoreInfo = { Beatmap = gameplayState.Beatmap.BeatmapInfo }
|
||||
ScoreInfo = { BeatmapInfo = gameplayState.Beatmap.BeatmapInfo }
|
||||
})
|
||||
{
|
||||
ScreenSpaceToGamefield = pos => recordingManager.ToLocalSpace(pos),
|
||||
|
|
|
@ -51,7 +51,7 @@ public TestSceneReplayRecording()
|
|||
Recorder = new TestReplayRecorder(new Score
|
||||
{
|
||||
Replay = replay,
|
||||
ScoreInfo = { Beatmap = gameplayState.Beatmap.BeatmapInfo }
|
||||
ScoreInfo = { BeatmapInfo = gameplayState.Beatmap.BeatmapInfo }
|
||||
})
|
||||
{
|
||||
ScreenSpaceToGamefield = pos => recordingManager.ToLocalSpace(pos)
|
||||
|
|
|
@ -356,7 +356,7 @@ public enum TestAction
|
|||
internal class TestReplayRecorder : ReplayRecorder<TestAction>
|
||||
{
|
||||
public TestReplayRecorder()
|
||||
: base(new Score { ScoreInfo = { Beatmap = new BeatmapInfo() } })
|
||||
: base(new Score { ScoreInfo = { BeatmapInfo = new BeatmapInfo() } })
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ public void TestDisplayResults()
|
|||
Accuracy = 0.8,
|
||||
MaxCombo = 500,
|
||||
Combo = 250,
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User { Username = "Test user" },
|
||||
Date = DateTimeOffset.Now,
|
||||
OnlineScoreID = 12345,
|
||||
|
|
|
@ -34,7 +34,7 @@ public void TestDisplayTeamResults(int team1Score, int team2Score)
|
|||
Accuracy = 0.8,
|
||||
MaxCombo = 500,
|
||||
Combo = 250,
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User { Username = "Test user" },
|
||||
Date = DateTimeOffset.Now,
|
||||
OnlineScoreID = 12345,
|
||||
|
|
|
@ -130,7 +130,7 @@ private Func<ScoreInfo> importScore(int i, RulesetInfo ruleset = null)
|
|||
{
|
||||
Hash = Guid.NewGuid().ToString(),
|
||||
OnlineScoreID = i,
|
||||
Beatmap = beatmap.Beatmaps.First(),
|
||||
BeatmapInfo = beatmap.Beatmaps.First(),
|
||||
Ruleset = ruleset ?? new OsuRuleset().RulesetInfo
|
||||
}).Result;
|
||||
});
|
||||
|
|
|
@ -23,7 +23,7 @@ public TestSceneUserProfileScores()
|
|||
{
|
||||
PP = 1047.21,
|
||||
Rank = ScoreRank.SH,
|
||||
Beatmap = new BeatmapInfo
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ public TestSceneUserProfileScores()
|
|||
{
|
||||
PP = 134.32,
|
||||
Rank = ScoreRank.A,
|
||||
Beatmap = new BeatmapInfo
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ public TestSceneUserProfileScores()
|
|||
{
|
||||
PP = 96.83,
|
||||
Rank = ScoreRank.S,
|
||||
Beatmap = new BeatmapInfo
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ public TestSceneUserProfileScores()
|
|||
var noPPScore = new ScoreInfo
|
||||
{
|
||||
Rank = ScoreRank.B,
|
||||
Beatmap = new BeatmapInfo
|
||||
BeatmapInfo = new BeatmapInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
|
|
|
@ -71,7 +71,7 @@ private void addCircleStep(ScoreInfo score) => AddStep("add panel", () =>
|
|||
Id = 2,
|
||||
Username = "peppy",
|
||||
},
|
||||
Beatmap = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo,
|
||||
BeatmapInfo = new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo,
|
||||
Mods = new Mod[] { new OsuModHardRock(), new OsuModDoubleTime() },
|
||||
TotalScore = 2845370,
|
||||
Accuracy = accuracy,
|
||||
|
|
|
@ -35,7 +35,7 @@ public void TestMapWithKnownMapper()
|
|||
|
||||
AddStep("show example score", () => showPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo)
|
||||
{
|
||||
Beatmap = createTestBeatmap(author)
|
||||
BeatmapInfo = createTestBeatmap(author)
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public void TestExcessMods()
|
|||
|
||||
AddStep("show excess mods score", () => showPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo, true)
|
||||
{
|
||||
Beatmap = createTestBeatmap(author)
|
||||
BeatmapInfo = createTestBeatmap(author)
|
||||
}));
|
||||
|
||||
AddAssert("mapper name present", () => this.ChildrenOfType<OsuSpriteText>().Any(spriteText => spriteText.Current.Value == "mapper_name"));
|
||||
|
@ -57,7 +57,7 @@ public void TestMapWithUnknownMapper()
|
|||
{
|
||||
AddStep("show example score", () => showPanel(new TestScoreInfo(new OsuRuleset().RulesetInfo)
|
||||
{
|
||||
Beatmap = createTestBeatmap(null)
|
||||
BeatmapInfo = createTestBeatmap(null)
|
||||
}));
|
||||
|
||||
AddAssert("mapped by text not present", () =>
|
||||
|
@ -79,7 +79,7 @@ public void TestWithDefaultDate()
|
|||
showPanel(new TestScoreInfo(ruleset.RulesetInfo)
|
||||
{
|
||||
Mods = mods,
|
||||
Beatmap = beatmap,
|
||||
BeatmapInfo = beatmap,
|
||||
Date = default,
|
||||
});
|
||||
});
|
||||
|
|
|
@ -337,8 +337,8 @@ private class UnrankedSoloResultsScreen : SoloResultsScreen
|
|||
public UnrankedSoloResultsScreen(ScoreInfo score)
|
||||
: base(score, true)
|
||||
{
|
||||
Score.Beatmap.OnlineBeatmapID = 0;
|
||||
Score.Beatmap.Status = BeatmapSetOnlineStatus.Pending;
|
||||
Score.BeatmapInfo.OnlineBeatmapID = 0;
|
||||
Score.BeatmapInfo.Status = BeatmapSetOnlineStatus.Pending;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
|
|
@ -197,7 +197,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 6602580,
|
||||
|
@ -216,7 +216,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 4608074,
|
||||
|
@ -235,7 +235,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 1014222,
|
||||
|
@ -254,7 +254,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 1541390,
|
||||
|
@ -273,7 +273,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 2243452,
|
||||
|
@ -292,7 +292,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 2705430,
|
||||
|
@ -311,7 +311,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 7151382,
|
||||
|
@ -330,7 +330,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 2051389,
|
||||
|
@ -349,7 +349,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 6169483,
|
||||
|
@ -368,7 +368,7 @@ private static ScoreInfo[] generateSampleScores(BeatmapInfo beatmapInfo)
|
|||
MaxCombo = 244,
|
||||
TotalScore = 1707827,
|
||||
//Mods = new Mod[] { new OsuModHidden(), new OsuModHardRock(), },
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
User = new User
|
||||
{
|
||||
Id = 6702666,
|
||||
|
|
|
@ -805,7 +805,7 @@ public void TestChangeRulesetWhilePresentingScore()
|
|||
songSelect.PresentScore(new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "woo" },
|
||||
Beatmap = getPresentBeatmap(),
|
||||
BeatmapInfo = getPresentBeatmap(),
|
||||
Ruleset = getPresentBeatmap().Ruleset
|
||||
});
|
||||
});
|
||||
|
@ -837,7 +837,7 @@ public void TestChangeBeatmapWhilePresentingScore()
|
|||
songSelect.PresentScore(new ScoreInfo
|
||||
{
|
||||
User = new User { Username = "woo" },
|
||||
Beatmap = getPresentBeatmap(),
|
||||
BeatmapInfo = getPresentBeatmap(),
|
||||
Ruleset = getPresentBeatmap().Ruleset
|
||||
});
|
||||
});
|
||||
|
|
|
@ -92,7 +92,7 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
|
|||
var score = new ScoreInfo
|
||||
{
|
||||
OnlineScoreID = i,
|
||||
Beatmap = beatmapInfo,
|
||||
BeatmapInfo = beatmapInfo,
|
||||
BeatmapInfoID = beatmapInfo.ID,
|
||||
Accuracy = RNG.NextDouble(),
|
||||
TotalScore = RNG.Next(1, 1000000),
|
||||
|
|
|
@ -37,7 +37,7 @@ public ScoreInfo CreateScoreInfo(RulesetStore rulesets)
|
|||
OnlineScoreID = OnlineScoreID,
|
||||
Date = Date,
|
||||
PP = PP,
|
||||
Beatmap = BeatmapInfo,
|
||||
BeatmapInfo = BeatmapInfo,
|
||||
RulesetID = OnlineRulesetID,
|
||||
Hash = Replay ? "online" : string.Empty, // todo: temporary?
|
||||
Rank = Rank,
|
||||
|
|
|
@ -70,7 +70,7 @@ public ScoreInfo CreateScoreInfo(PlaylistItem playlistItem)
|
|||
OnlineScoreID = ID,
|
||||
TotalScore = TotalScore,
|
||||
MaxCombo = MaxCombo,
|
||||
Beatmap = playlistItem.Beatmap.Value,
|
||||
BeatmapInfo = playlistItem.Beatmap.Value,
|
||||
BeatmapInfoID = playlistItem.BeatmapID,
|
||||
Ruleset = playlistItem.Ruleset.Value,
|
||||
RulesetID = playlistItem.RulesetID,
|
||||
|
|
|
@ -144,7 +144,7 @@ public void BeginPlaying(GameplayState state, Score score)
|
|||
IsPlaying = true;
|
||||
|
||||
// transfer state at point of beginning play
|
||||
currentState.BeatmapID = score.ScoreInfo.Beatmap.OnlineBeatmapID;
|
||||
currentState.BeatmapID = score.ScoreInfo.BeatmapInfo.OnlineBeatmapID;
|
||||
currentState.RulesetID = score.ScoreInfo.RulesetID;
|
||||
currentState.Mods = score.ScoreInfo.Mods.Select(m => new APIMod(m)).ToArray();
|
||||
|
||||
|
|
|
@ -482,7 +482,7 @@ public void PresentScore(ScoreInfo score, ScorePresentType presentType = ScorePr
|
|||
return;
|
||||
}
|
||||
|
||||
var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == databasedScoreInfo.Beatmap.ID);
|
||||
var databasedBeatmap = BeatmapManager.QueryBeatmap(b => b.ID == databasedScoreInfo.BeatmapInfo.ID);
|
||||
|
||||
if (databasedBeatmap == null)
|
||||
{
|
||||
|
|
|
@ -250,7 +250,7 @@ private void load()
|
|||
List<ScoreInfo> getBeatmapScores(BeatmapSetInfo set)
|
||||
{
|
||||
var beatmapIds = BeatmapManager.QueryBeatmaps(b => b.BeatmapSetInfoID == set.ID).Select(b => b.ID).ToList();
|
||||
return ScoreManager.QueryScores(s => beatmapIds.Contains(s.Beatmap.ID)).ToList();
|
||||
return ScoreManager.QueryScores(s => beatmapIds.Contains(s.BeatmapInfo.ID)).ToList();
|
||||
}
|
||||
|
||||
BeatmapManager.ItemRemoved.BindValueChanged(i =>
|
||||
|
|
|
@ -172,7 +172,7 @@ private Drawable[] createContent(int index, ScoreInfo score)
|
|||
{
|
||||
Text = score.MaxCombo.ToLocalisableString(@"0\x"),
|
||||
Font = OsuFont.GetFont(size: text_size),
|
||||
Colour = score.MaxCombo == score.Beatmap?.MaxCombo ? highAccuracyColour : Color4.White
|
||||
Colour = score.MaxCombo == score.BeatmapInfo?.MaxCombo ? highAccuracyColour : Color4.White
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ protected APILegacyScores Scores
|
|||
|
||||
var topScore = ordered.Result.First();
|
||||
|
||||
scoreTable.DisplayScores(ordered.Result, topScore.Beatmap?.Status.GrantsPerformancePoints() == true);
|
||||
scoreTable.DisplayScores(ordered.Result, topScore.BeatmapInfo?.Status.GrantsPerformancePoints() == true);
|
||||
scoreTable.Show();
|
||||
|
||||
var userScore = value.UserScore;
|
||||
|
|
|
@ -115,7 +115,7 @@ public ScoreInfo Score
|
|||
accuracyColumn.Text = value.DisplayAccuracy;
|
||||
maxComboColumn.Text = value.MaxCombo.ToLocalisableString(@"0\x");
|
||||
|
||||
ppColumn.Alpha = value.Beatmap?.Status.GrantsPerformancePoints() == true ? 1 : 0;
|
||||
ppColumn.Alpha = value.BeatmapInfo?.Status.GrantsPerformancePoints() == true ? 1 : 0;
|
||||
ppColumn.Text = value.PP?.ToLocalisableString(@"N0");
|
||||
|
||||
statisticsColumns.ChildrenEnumerable = value.GetStatisticsForDisplay().Select(createStatisticsColumn);
|
||||
|
|
|
@ -78,7 +78,7 @@ private void load()
|
|||
Spacing = new Vector2(0, 2),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new ScoreBeatmapMetadataContainer(Score.Beatmap),
|
||||
new ScoreBeatmapMetadataContainer(Score.BeatmapInfo),
|
||||
new FillFlowContainer
|
||||
{
|
||||
AutoSizeAxes = Axes.Both,
|
||||
|
@ -88,7 +88,7 @@ private void load()
|
|||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = $"{Score.Beatmap.Version}",
|
||||
Text = $"{Score.BeatmapInfo.Version}",
|
||||
Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular),
|
||||
Colour = colours.Yellow
|
||||
},
|
||||
|
|
|
@ -70,7 +70,7 @@ public Score Parse(Stream stream)
|
|||
scoreInfo.Mods = scoreInfo.Mods.Append(currentRuleset.CreateMod<ModClassic>()).ToArray();
|
||||
|
||||
currentBeatmap = workingBeatmap.GetPlayableBeatmap(currentRuleset.RulesetInfo, scoreInfo.Mods);
|
||||
scoreInfo.Beatmap = currentBeatmap.BeatmapInfo;
|
||||
scoreInfo.BeatmapInfo = currentBeatmap.BeatmapInfo;
|
||||
|
||||
/* score.HpGraphString = */
|
||||
sr.ReadString();
|
||||
|
@ -119,7 +119,7 @@ public Score Parse(Stream stream)
|
|||
|
||||
// before returning for database import, we must restore the database-sourced BeatmapInfo.
|
||||
// if not, the clone operation in GetPlayableBeatmap will cause a dereference and subsequent database exception.
|
||||
score.ScoreInfo.Beatmap = workingBeatmap.BeatmapInfo;
|
||||
score.ScoreInfo.BeatmapInfo = workingBeatmap.BeatmapInfo;
|
||||
|
||||
return score;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public LegacyScoreEncoder(Score score, IBeatmap beatmap)
|
|||
this.score = score;
|
||||
this.beatmap = beatmap;
|
||||
|
||||
if (score.ScoreInfo.Beatmap.RulesetID < 0 || score.ScoreInfo.Beatmap.RulesetID > 3)
|
||||
if (score.ScoreInfo.BeatmapInfo.RulesetID < 0 || score.ScoreInfo.BeatmapInfo.RulesetID > 3)
|
||||
throw new ArgumentException("Only scores in the osu, taiko, catch, or mania rulesets can be encoded to the legacy score format.", nameof(score));
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ public void Encode(Stream stream)
|
|||
{
|
||||
sw.Write((byte)(score.ScoreInfo.Ruleset.ID ?? 0));
|
||||
sw.Write(LATEST_VERSION);
|
||||
sw.Write(score.ScoreInfo.Beatmap.MD5Hash);
|
||||
sw.Write(score.ScoreInfo.BeatmapInfo.MD5Hash);
|
||||
sw.Write(score.ScoreInfo.UserString);
|
||||
sw.Write($"lazer-{score.ScoreInfo.UserString}-{score.ScoreInfo.Date}".ComputeMD5Hash());
|
||||
sw.Write((ushort)(score.ScoreInfo.GetCount300() ?? 0));
|
||||
|
|
|
@ -150,7 +150,8 @@ public int? UserID
|
|||
public int BeatmapInfoID { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual BeatmapInfo Beatmap { get; set; }
|
||||
[Column("Beatmap")]
|
||||
public virtual BeatmapInfo BeatmapInfo { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public long? OnlineScoreID { get; set; }
|
||||
|
@ -252,7 +253,7 @@ public ScoreInfo DeepClone()
|
|||
return clone;
|
||||
}
|
||||
|
||||
public override string ToString() => $"{User} playing {Beatmap}";
|
||||
public override string ToString() => $"{User} playing {BeatmapInfo}";
|
||||
|
||||
public bool Equals(ScoreInfo other)
|
||||
{
|
||||
|
|
|
@ -67,7 +67,7 @@ public async Task<ScoreInfo[]> OrderByTotalScoreAsync(ScoreInfo[] scores, Cancel
|
|||
// Compute difficulties asynchronously first to prevent blocking via the GetTotalScore() call below.
|
||||
foreach (var s in scores)
|
||||
{
|
||||
await difficultyCache.GetDifficultyAsync(s.Beatmap, s.Ruleset, s.Mods, cancellationToken).ConfigureAwait(false);
|
||||
await difficultyCache.GetDifficultyAsync(s.BeatmapInfo, s.Ruleset, s.Mods, cancellationToken).ConfigureAwait(false);
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public void GetTotalScore([NotNull] ScoreInfo score, [NotNull] Action<long> call
|
|||
/// <returns>The total score.</returns>
|
||||
public async Task<long> GetTotalScoreAsync([NotNull] ScoreInfo score, ScoringMode mode = ScoringMode.Standardised, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (score.Beatmap == null)
|
||||
if (score.BeatmapInfo == null)
|
||||
return score.TotalScore;
|
||||
|
||||
int beatmapMaxCombo;
|
||||
|
@ -147,18 +147,18 @@ public async Task<long> GetTotalScoreAsync([NotNull] ScoreInfo score, ScoringMod
|
|||
|
||||
// This score is guaranteed to be an osu!stable score.
|
||||
// The combo must be determined through either the beatmap's max combo value or the difficulty calculator, as lazer's scoring has changed and the score statistics cannot be used.
|
||||
if (score.Beatmap.MaxCombo != null)
|
||||
beatmapMaxCombo = score.Beatmap.MaxCombo.Value;
|
||||
if (score.BeatmapInfo.MaxCombo != null)
|
||||
beatmapMaxCombo = score.BeatmapInfo.MaxCombo.Value;
|
||||
else
|
||||
{
|
||||
if (score.Beatmap.ID == 0 || difficulties == null)
|
||||
if (score.BeatmapInfo.ID == 0 || difficulties == null)
|
||||
{
|
||||
// We don't have enough information (max combo) to compute the score, so use the provided score.
|
||||
return score.TotalScore;
|
||||
}
|
||||
|
||||
// We can compute the max combo locally after the async beatmap difficulty computation.
|
||||
var difficulty = await difficulties().GetDifficultyAsync(score.Beatmap, score.Ruleset, score.Mods, cancellationToken).ConfigureAwait(false);
|
||||
var difficulty = await difficulties().GetDifficultyAsync(score.BeatmapInfo, score.Ruleset, score.Mods, cancellationToken).ConfigureAwait(false);
|
||||
beatmapMaxCombo = difficulty.MaxCombo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class ScorePerformanceCache : MemoryCachingComponent<ScorePerformanceCach
|
|||
{
|
||||
var score = lookup.ScoreInfo;
|
||||
|
||||
var attributes = await difficultyCache.GetDifficultyAsync(score.Beatmap, score.Ruleset, score.Mods, token).ConfigureAwait(false);
|
||||
var attributes = await difficultyCache.GetDifficultyAsync(score.BeatmapInfo, score.Ruleset, score.Mods, token).ConfigureAwait(false);
|
||||
|
||||
// Performance calculation requires the beatmap and ruleset to be locally available. If not, return a default value.
|
||||
if (attributes.Attributes == null)
|
||||
|
|
|
@ -17,9 +17,9 @@ public ScoreStore(IDatabaseContextFactory factory, Storage storage)
|
|||
|
||||
protected override IQueryable<ScoreInfo> AddIncludesForConsumption(IQueryable<ScoreInfo> query)
|
||||
=> base.AddIncludesForConsumption(query)
|
||||
.Include(s => s.Beatmap)
|
||||
.Include(s => s.Beatmap).ThenInclude(b => b.Metadata)
|
||||
.Include(s => s.Beatmap).ThenInclude(b => b.BeatmapSet).ThenInclude(s => s.Metadata)
|
||||
.Include(s => s.BeatmapInfo)
|
||||
.Include(s => s.BeatmapInfo).ThenInclude(b => b.Metadata)
|
||||
.Include(s => s.BeatmapInfo).ThenInclude(b => b.BeatmapSet).ThenInclude(s => s.Metadata)
|
||||
.Include(s => s.Ruleset);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ public void LoadScore([NotNull] Score score)
|
|||
|
||||
Score = score;
|
||||
|
||||
gameplayContent.Child = new PlayerIsolationContainer(beatmapManager.GetWorkingBeatmap(Score.ScoreInfo.Beatmap), Score.ScoreInfo.Ruleset, Score.ScoreInfo.Mods)
|
||||
gameplayContent.Child = new PlayerIsolationContainer(beatmapManager.GetWorkingBeatmap(Score.ScoreInfo.BeatmapInfo), Score.ScoreInfo.Ruleset, Score.ScoreInfo.Mods)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Child = stack = new OsuScreenStack()
|
||||
|
|
|
@ -164,7 +164,7 @@ protected override void LoadComplete()
|
|||
Score = CreateScore();
|
||||
|
||||
// ensure the score is in a consistent state with the current player.
|
||||
Score.ScoreInfo.Beatmap = Beatmap.Value.BeatmapInfo;
|
||||
Score.ScoreInfo.BeatmapInfo = Beatmap.Value.BeatmapInfo;
|
||||
Score.ScoreInfo.Ruleset = ruleset.RulesetInfo;
|
||||
Score.ScoreInfo.Mods = Mods.Value.ToArray();
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ protected override APIRequest<APIScoreToken> CreateTokenRequest()
|
|||
|
||||
protected override APIRequest<MultiplayerScore> CreateSubmissionRequest(Score score, long token)
|
||||
{
|
||||
var beatmap = score.ScoreInfo.Beatmap;
|
||||
var beatmap = score.ScoreInfo.BeatmapInfo;
|
||||
|
||||
Debug.Assert(beatmap.OnlineBeatmapID != null);
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public ExpandedPanelMiddleContent(ScoreInfo score, bool withFlair = false)
|
|||
[BackgroundDependencyLoader]
|
||||
private void load(BeatmapDifficultyCache beatmapDifficultyCache)
|
||||
{
|
||||
var beatmap = score.Beatmap;
|
||||
var beatmap = score.BeatmapInfo;
|
||||
var metadata = beatmap.BeatmapSet?.Metadata ?? beatmap.Metadata;
|
||||
var creator = metadata.Author?.Username;
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ public SoloResultsScreen(ScoreInfo score, bool allowRetry)
|
|||
|
||||
protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresCallback)
|
||||
{
|
||||
if (Score.Beatmap.OnlineBeatmapID == null || Score.Beatmap.Status <= BeatmapSetOnlineStatus.Pending)
|
||||
if (Score.BeatmapInfo.OnlineBeatmapID == null || Score.BeatmapInfo.Status <= BeatmapSetOnlineStatus.Pending)
|
||||
return null;
|
||||
|
||||
getScoreRequest = new GetScoresRequest(Score.Beatmap, Score.Ruleset);
|
||||
getScoreRequest = new GetScoresRequest(Score.BeatmapInfo, Score.Ruleset);
|
||||
getScoreRequest.Success += r => scoresCallback?.Invoke(r.Scores.Where(s => s.OnlineScoreID != Score.OnlineScoreID).Select(s => s.CreateScoreInfo(rulesets)));
|
||||
return getScoreRequest;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ private void populateStatistics(ValueChangedEvent<ScoreInfo> score)
|
|||
// Todo: The placement of this is temporary. Eventually we'll both generate the playable beatmap _and_ run through it in a background task to generate the hit events.
|
||||
Task.Run(() =>
|
||||
{
|
||||
playableBeatmap = beatmapManager.GetWorkingBeatmap(newScore.Beatmap).GetPlayableBeatmap(newScore.Ruleset, newScore.Mods ?? Array.Empty<Mod>());
|
||||
playableBeatmap = beatmapManager.GetWorkingBeatmap(newScore.BeatmapInfo).GetPlayableBeatmap(newScore.Ruleset, newScore.Mods ?? Array.Empty<Mod>());
|
||||
}, loadCancellation.Token).ContinueWith(t => Schedule(() =>
|
||||
{
|
||||
var rows = new FillFlowContainer
|
||||
|
|
|
@ -29,7 +29,7 @@ public BeatmapClearScoresDialog(BeatmapInfo beatmapInfo, Action onCompletion)
|
|||
Text = @"Yes. Please.",
|
||||
Action = () =>
|
||||
{
|
||||
Task.Run(() => scoreManager.Delete(scoreManager.QueryScores(s => !s.DeletePending && s.Beatmap.ID == beatmapInfo.ID).ToList()))
|
||||
Task.Run(() => scoreManager.Delete(scoreManager.QueryScores(s => !s.DeletePending && s.BeatmapInfo.ID == beatmapInfo.ID).ToList()))
|
||||
.ContinueWith(_ => onCompletion);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -141,7 +141,7 @@ protected override APIRequest FetchScores(Action<IEnumerable<ScoreInfo>> scoresC
|
|||
if (Scope == BeatmapLeaderboardScope.Local)
|
||||
{
|
||||
var scores = scoreManager
|
||||
.QueryScores(s => !s.DeletePending && s.Beatmap.ID == BeatmapInfo.ID && s.Ruleset.ID == ruleset.Value.ID);
|
||||
.QueryScores(s => !s.DeletePending && s.BeatmapInfo.ID == BeatmapInfo.ID && s.Ruleset.ID == ruleset.Value.ID);
|
||||
|
||||
if (filterMods && !mods.Value.Any())
|
||||
{
|
||||
|
|
|
@ -39,7 +39,7 @@ private void load(OsuColour colours)
|
|||
}
|
||||
|
||||
protected void PresentScore(ScoreInfo score) =>
|
||||
FinaliseSelection(score.Beatmap, score.Ruleset, () => this.Push(new SoloResultsScreen(score, false)));
|
||||
FinaliseSelection(score.BeatmapInfo, score.Ruleset, () => this.Push(new SoloResultsScreen(score, false)));
|
||||
|
||||
protected override BeatmapDetailArea CreateBeatmapDetailArea() => new PlayBeatmapDetailArea();
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ private void updateGameplayState(int userId)
|
|||
{
|
||||
ScoreInfo = new ScoreInfo
|
||||
{
|
||||
Beatmap = resolvedBeatmap,
|
||||
BeatmapInfo = resolvedBeatmap,
|
||||
User = user,
|
||||
Mods = spectatorState.Mods.Select(m => m.ToMod(resolvedRuleset)).ToArray(),
|
||||
Ruleset = resolvedRuleset.RulesetInfo,
|
||||
|
|
|
@ -23,7 +23,7 @@ public TestScoreInfo(RulesetInfo ruleset, bool excessMods = false)
|
|||
CoverUrl = "https://osu.ppy.sh/images/headers/profile-covers/c3.jpg",
|
||||
};
|
||||
|
||||
Beatmap = new TestBeatmap(ruleset).BeatmapInfo;
|
||||
BeatmapInfo = new TestBeatmap(ruleset).BeatmapInfo;
|
||||
Ruleset = ruleset;
|
||||
RulesetID = ruleset.ID ?? 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue