Apply batch fixing of built-in types using var

This commit is contained in:
Dean Herbert
2021-10-27 13:04:41 +09:00
parent 1d7e97625a
commit 6944151486
263 changed files with 572 additions and 572 deletions

View File

@ -32,7 +32,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ PLAYER_2_ID, new ManualClock() }
};
foreach (var (userId, _) in clocks)
foreach ((int userId, var _) in clocks)
{
SpectatorClient.StartPlay(userId, 0);
OnlinePlayDependencies.Client.AddUser(new User { Id = userId });
@ -53,7 +53,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("add clock sources", () =>
{
foreach (var (userId, clock) in clocks)
foreach ((int userId, var clock) in clocks)
leaderboard.AddClock(userId, clock);
});
}

View File

@ -289,7 +289,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
[Test]
public void TestSpectatingDuringGameplay()
{
var players = new[] { PLAYER_1_ID, PLAYER_2_ID };
int[] players = new[] { PLAYER_1_ID, PLAYER_2_ID };
start(players);
sendFrames(players, 300);
@ -326,7 +326,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
for (int count = 3; count >= 0; count--)
{
var id = PLAYER_1_ID + count;
int id = PLAYER_1_ID + count;
end(id);
AddUntilStep($"{id} area grayed", () => getInstance(id).Colour != Color4.White);

View File

@ -582,7 +582,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
// Gameplay runs in real-time, so we need to incrementally check if gameplay has finished in order to not time out.
for (double i = 1000; i < TestResources.QUICK_BEATMAP_LENGTH; i += 1000)
{
var time = i;
double time = i;
AddUntilStep($"wait for time > {i}", () => this.ChildrenOfType<GameplayClockContainer>().SingleOrDefault()?.GameplayClock.CurrentTime > time);
}

View File

@ -55,7 +55,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
var playableBeatmap = Beatmap.Value.GetPlayableBeatmap(Ruleset.Value);
var multiplayerUsers = new List<MultiplayerRoomUser>();
foreach (var user in users)
foreach (int user in users)
{
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
multiplayerUsers.Add(OnlinePlayDependencies.Client.AddUser(new User { Id = user }, true));
@ -89,7 +89,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
[Test]
public void TestUserQuit()
{
foreach (var user in users)
foreach (int user in users)
AddStep($"mark user {user} quit", () => Client.RemoveUser(LookupCache.GetUserAsync(user).Result.AsNonNull()));
}
@ -114,7 +114,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
public void RandomlyUpdateState()
{
foreach (var userId in PlayingUsers)
foreach (int userId in PlayingUsers)
{
if (RNG.NextBool())
continue;

View File

@ -59,7 +59,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
var playableBeatmap = Beatmap.Value.GetPlayableBeatmap(Ruleset.Value);
var multiplayerUsers = new List<MultiplayerRoomUser>();
foreach (var user in users)
foreach (int user in users)
{
SpectatorClient.StartPlay(user, Beatmap.Value.BeatmapInfo.OnlineBeatmapID ?? 0);
var roomUser = OnlinePlayDependencies.Client.AddUser(new User { Id = user }, true);

View File

@ -112,7 +112,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddRepeatStep("increment progress", () =>
{
var progress = this.ChildrenOfType<ParticipantPanel>().Single().User.BeatmapAvailability.DownloadProgress ?? 0;
float progress = this.ChildrenOfType<ParticipantPanel>().Single().User.BeatmapAvailability.DownloadProgress ?? 0;
Client.ChangeBeatmapAvailability(BeatmapAvailability.Downloading(progress + RNG.NextSingle(0.1f)));
}, 25);