Refactored variable names in OsuGame.cs for improved code readability.

This commit is contained in:
unknown 2018-08-29 18:04:51 -04:00
parent df18508bd6
commit 499c5d28ff

View File

@ -75,10 +75,10 @@ namespace osu.Game
{ {
get get
{ {
Screen s = screenStack; Screen screen = screenStack;
while (s != null && !(s is Intro)) while (screen != null && !(screen is Intro))
s = s.ChildScreen; screen = screen.ChildScreen;
return s as Intro; return screen as Intro;
} }
} }
@ -126,8 +126,8 @@ namespace osu.Game
/// <param name="toolbar">Whether the toolbar should also be hidden.</param> /// <param name="toolbar">Whether the toolbar should also be hidden.</param>
public void CloseAllOverlays(bool toolbar = true) public void CloseAllOverlays(bool toolbar = true)
{ {
foreach (var o in overlays) foreach (var overlay in overlays)
o.State = Visibility.Hidden; overlay.State = Visibility.Hidden;
if (toolbar) Toolbar.State = Visibility.Hidden; if (toolbar) Toolbar.State = Visibility.Hidden;
} }
@ -244,7 +244,7 @@ namespace osu.Game
/// <param name="beatmapId">The beatmap to show.</param> /// <param name="beatmapId">The beatmap to show.</param>
public void ShowBeatmap(int beatmapId) => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId); public void ShowBeatmap(int beatmapId) => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId);
protected void LoadScore(Score s) protected void LoadScore(Score score)
{ {
scoreLoad?.Cancel(); scoreLoad?.Cancel();
@ -252,18 +252,18 @@ namespace osu.Game
if (menu == null) if (menu == null)
{ {
scoreLoad = Schedule(() => LoadScore(s)); scoreLoad = Schedule(() => LoadScore(score));
return; return;
} }
if (!menu.IsCurrentScreen) if (!menu.IsCurrentScreen)
{ {
menu.MakeCurrent(); menu.MakeCurrent();
this.Delay(500).Schedule(() => LoadScore(s), out scoreLoad); this.Delay(500).Schedule(() => LoadScore(score), out scoreLoad);
return; return;
} }
if (s.Beatmap == null) if (score.Beatmap == null)
{ {
notifications.Post(new SimpleNotification notifications.Post(new SimpleNotification
{ {
@ -273,12 +273,12 @@ namespace osu.Game
return; return;
} }
ruleset.Value = s.Ruleset; ruleset.Value = score.Ruleset;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(s.Beatmap); Beatmap.Value = BeatmapManager.GetWorkingBeatmap(score.Beatmap);
Beatmap.Value.Mods.Value = s.Mods; Beatmap.Value.Mods.Value = score.Mods;
menu.Push(new PlayerLoader(new ReplayPlayer(s.Replay))); menu.Push(new PlayerLoader(new ReplayPlayer(score.Replay)));
} }
protected override void Dispose(bool isDisposing) protected override void Dispose(bool isDisposing)