1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:02:55 +08:00

Rename PlayingUserStates -> WatchingUserStates

This commit is contained in:
Dan Balasescu 2022-02-02 23:11:29 +09:00
parent 589f5e7a31
commit fcbba3d948
5 changed files with 11 additions and 11 deletions

View File

@ -37,8 +37,8 @@ namespace osu.Game.Tests.Visual.Gameplay
[Test]
public void TestClientSendsCorrectRuleset()
{
AddUntilStep("spectator client sending frames", () => spectatorClient.PlayingUserStates.ContainsKey(dummy_user_id));
AddAssert("spectator client sent correct ruleset", () => spectatorClient.PlayingUserStates[dummy_user_id].RulesetID == Ruleset.Value.OnlineID);
AddUntilStep("spectator client sending frames", () => spectatorClient.WatchingUserStates.ContainsKey(dummy_user_id));
AddAssert("spectator client sent correct ruleset", () => spectatorClient.WatchingUserStates[dummy_user_id].RulesetID == Ruleset.Value.OnlineID);
}
public override void TearDownSteps()

View File

@ -115,7 +115,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
public void RandomlyUpdateState()
{
foreach ((int userId, _) in PlayingUserStates)
foreach ((int userId, _) in WatchingUserStates)
{
if (RNG.NextBool())
continue;

View File

@ -37,8 +37,8 @@ namespace osu.Game.Online.Spectator
private readonly List<int> watchingUsers = new List<int>();
public IBindableDictionary<int, SpectatorState> PlayingUserStates => playingUserStates;
private readonly BindableDictionary<int, SpectatorState> playingUserStates = new BindableDictionary<int, SpectatorState>();
public IBindableDictionary<int, SpectatorState> WatchingUserStates => watchingUserStates;
private readonly BindableDictionary<int, SpectatorState> watchingUserStates = new BindableDictionary<int, SpectatorState>();
private IBeatmap? currentBeatmap;
private Score? currentScore;
@ -85,7 +85,7 @@ namespace osu.Game.Online.Spectator
BeginPlayingInternal(currentState);
}
else
playingUserStates.Clear();
watchingUserStates.Clear();
}), true);
}
@ -94,7 +94,7 @@ namespace osu.Game.Online.Spectator
Schedule(() =>
{
if (watchingUsers.Contains(userId))
playingUserStates[userId] = state;
watchingUserStates[userId] = state;
OnUserBeganPlaying?.Invoke(userId, state);
});
@ -106,7 +106,7 @@ namespace osu.Game.Online.Spectator
Schedule(() =>
{
if (watchingUsers.Contains(userId))
playingUserStates[userId] = state;
watchingUserStates[userId] = state;
OnUserFinishedPlaying?.Invoke(userId, state);
});
@ -193,7 +193,7 @@ namespace osu.Game.Online.Spectator
Schedule(() =>
{
watchingUsers.Remove(userId);
playingUserStates.Remove(userId);
watchingUserStates.Remove(userId);
StopWatchingUserInternal(userId);
});
}

View File

@ -51,7 +51,7 @@ namespace osu.Game.Overlays.Dashboard
{
base.LoadComplete();
userStates.BindTo(spectatorClient.PlayingUserStates);
userStates.BindTo(spectatorClient.WatchingUserStates);
userStates.BindCollectionChanged(onUserStatesChanged, true);
}

View File

@ -77,7 +77,7 @@ namespace osu.Game.Screens.Spectate
userMap[u.Id] = u;
}
userStates.BindTo(spectatorClient.PlayingUserStates);
userStates.BindTo(spectatorClient.WatchingUserStates);
userStates.BindCollectionChanged(onUserStatesChanged, true);
realmSubscription = realm.RegisterForNotifications(