mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:42:55 +08:00
Remove remaining Room!=null
checks in TestMultiplayerClient
where possible
This commit is contained in:
parent
9ed37621a7
commit
158f0a1f23
@ -87,8 +87,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
switch (Room?.MatchState)
|
||||
{
|
||||
case TeamVersusRoomState teamVersus:
|
||||
Debug.Assert(Room != null);
|
||||
|
||||
// simulate the server's automatic assignment of users to teams on join.
|
||||
// the "best" team is the one with the least users on it.
|
||||
int bestTeam = teamVersus.Teams
|
||||
@ -103,6 +101,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
public void RemoveUser(APIUser user)
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
|
||||
((IMultiplayerClient)this).UserLeft(new MultiplayerRoomUser(user.Id));
|
||||
|
||||
Schedule(() =>
|
||||
@ -114,25 +113,23 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
public void ChangeRoomState(MultiplayerRoomState newState)
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
((IMultiplayerClient)this).RoomStateChanged(newState);
|
||||
}
|
||||
|
||||
public void ChangeUserState(int userId, MultiplayerUserState newState)
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
|
||||
((IMultiplayerClient)this).UserStateChanged(userId, newState);
|
||||
updateRoomStateIfRequired();
|
||||
}
|
||||
|
||||
private void updateRoomStateIfRequired()
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
Debug.Assert(APIRoom != null);
|
||||
|
||||
Schedule(() =>
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
|
||||
switch (Room.State)
|
||||
{
|
||||
case MultiplayerRoomState.Open:
|
||||
@ -179,8 +176,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
public void ChangeUserBeatmapAvailability(int userId, BeatmapAvailability newBeatmapAvailability)
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
|
||||
((IMultiplayerClient)this).UserBeatmapAvailabilityChanged(userId, newBeatmapAvailability);
|
||||
}
|
||||
|
||||
@ -290,7 +285,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
public void ChangeUserMods(int userId, IEnumerable<APIMod> newMods)
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
((IMultiplayerClient)this).UserModsChanged(userId, newMods.ToList());
|
||||
}
|
||||
|
||||
@ -338,7 +332,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
public override Task AbortGameplay()
|
||||
{
|
||||
Debug.Assert(Room != null);
|
||||
Debug.Assert(LocalUser != null);
|
||||
|
||||
ChangeUserState(LocalUser.UserID, MultiplayerUserState.Idle);
|
||||
|
Loading…
Reference in New Issue
Block a user