Use switch for screen construction

This commit is contained in:
Dean Herbert 2021-05-03 14:04:20 +09:00
parent 66ae6e58d1
commit dc5ee31d94

View File

@ -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)