1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 01:19:52 +08:00

Use switch statement class type matching

This commit is contained in:
Dean Herbert
2025-03-16 12:09:10 +09:00
Unverified
parent 0bde11b504
commit ef8448caaa
@@ -187,7 +187,19 @@ namespace osu.Game.Overlays.Dashboard
// TODO: we probably don't want to do this every frame.
var activity = metadataClient?.GetPresence(User.Id)?.Activity;
spectateButton.Enabled.Value = activity is UserActivity.InSoloGame or UserActivity.InMultiplayerGame or UserActivity.InPlaylistGame;
switch (activity)
{
default:
spectateButton.Enabled.Value = false;
break;
case UserActivity.InSoloGame:
case UserActivity.InMultiplayerGame:
case UserActivity.InPlaylistGame:
spectateButton.Enabled.Value = true;
break;
}
}
[BackgroundDependencyLoader]