1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Remove unnecessary properties and parameters

This commit is contained in:
Dean Herbert 2021-11-04 13:33:54 +09:00
parent 3453160a8b
commit 05f1fd4bc9
3 changed files with 9 additions and 8 deletions

View File

@ -69,7 +69,7 @@ namespace osu.Game.Online.Rooms
Ruleset.BindValueChanged(ruleset => RulesetID = ruleset.NewValue?.ID ?? 0);
}
public void MapObjects(BeatmapManager beatmaps, RulesetStore rulesets)
public void MapObjects(RulesetStore rulesets)
{
Beatmap.Value ??= APIBeatmap;
Ruleset.Value ??= rulesets.GetRuleset(RulesetID);

View File

@ -119,7 +119,7 @@ namespace osu.Game.Screens.OnlinePlay.Components
try
{
foreach (var pi in room.Playlist)
pi.MapObjects(beatmaps, rulesets);
pi.MapObjects(rulesets);
var existing = rooms.FirstOrDefault(e => e.RoomID.Value == room.RoomID.Value);
if (existing == null)

View File

@ -51,7 +51,6 @@ namespace osu.Game.Screens.Play
private Container beatmapPanelContainer;
private TriangleButton watchButton;
private SettingsCheckbox automaticDownload;
private APIBeatmapSet onlineBeatmap;
/// <summary>
/// The player's immediate online gameplay state.
@ -61,6 +60,8 @@ namespace osu.Game.Screens.Play
private GetBeatmapSetRequest onlineBeatmapRequest;
private APIBeatmapSet beatmapSet;
public SoloSpectator([NotNull] User targetUser)
: base(targetUser.Id)
{
@ -221,10 +222,10 @@ namespace osu.Game.Screens.Play
Debug.Assert(state.BeatmapID != null);
onlineBeatmapRequest = new GetBeatmapSetRequest(state.BeatmapID.Value, BeatmapSetLookupType.BeatmapId);
onlineBeatmapRequest.Success += res => Schedule(() =>
onlineBeatmapRequest.Success += beatmapSet => Schedule(() =>
{
onlineBeatmap = res;
beatmapPanelContainer.Child = new GridBeatmapPanel(onlineBeatmap);
this.beatmapSet = beatmapSet;
beatmapPanelContainer.Child = new GridBeatmapPanel(this.beatmapSet);
checkForAutomaticDownload();
});
@ -233,14 +234,14 @@ namespace osu.Game.Screens.Play
private void checkForAutomaticDownload()
{
if (onlineBeatmap == null)
if (beatmapSet == null)
return;
if (!automaticDownload.Current.Value)
return;
// Used to interact with manager classes that don't support interface types. Will eventually be replaced.
var beatmapSetInfo = new BeatmapSetInfo { OnlineBeatmapSetID = onlineBeatmap.OnlineID };
var beatmapSetInfo = new BeatmapSetInfo { OnlineBeatmapSetID = beatmapSet.OnlineID };
if (beatmaps.IsAvailableLocally(beatmapSetInfo))
return;