From dc5ee31d946918c2cbb2d0727e6039544b3a38d3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 3 May 2021 14:04:20 +0900 Subject: [PATCH] Use switch for screen construction --- .../Multiplayer/MultiplayerMatchSubScreen.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs index e6ce135660..ab22d40181 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs @@ -433,10 +433,16 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer { Debug.Assert(client.LocalUser != null); - if (client.LocalUser.State == MultiplayerUserState.Spectating) - return new MultiSpectatorScreen(client.CurrentMatchPlayingUserIds.ToArray()); + int[] userIds = client.CurrentMatchPlayingUserIds.ToArray(); - return new MultiplayerPlayer(SelectedItem.Value, client.CurrentMatchPlayingUserIds.ToArray()); + switch (client.LocalUser.State) + { + case MultiplayerUserState.Spectating: + return new MultiSpectatorScreen(userIds); + + default: + return new MultiplayerPlayer(SelectedItem.Value, userIds); + } } protected override void Dispose(bool isDisposing)