From da751804b68889f1988f0b51fb9bb87bdfeb6c47 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 9 Mar 2017 14:24:16 +0900 Subject: [PATCH] Reduce error count. --- osu.Desktop.Deploy/GitHubObject.cs | 2 +- osu.Desktop.Deploy/GitHubRelease.cs | 2 +- osu.Desktop/OsuGameDesktop.cs | 5 +---- osu.Game.Modes.Mania/UI/ManiaComboCounter.cs | 2 +- .../Objects/CircularArcApproximator.cs | 9 +++------ .../Drawables/Connections/FollowPointRenderer.cs | 5 ++--- osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs | 8 ++++---- osu.Game/IO/Legacy/SerializationReader.cs | 8 +++++--- osu.Game/IO/Legacy/SerializationWriter.cs | 15 ++++++++++----- osu.Game/IPC/BeatmapIPCChannel.cs | 2 +- osu.Game/IPC/ScoreIPCChannel.cs | 7 +++++-- osu.Game/Modes/LegacyReplay.cs | 2 +- osu.Game/Modes/UI/ComboCounter.cs | 10 +--------- osu.Game/Online/API/APIRequest.cs | 2 +- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 +- osu.Game/Overlays/Options/OptionDropDown.cs | 2 +- osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 3 --- osu.Game/Overlays/Toolbar/ToolbarUserButton.cs | 6 +----- .../Backgrounds/BackgroundScreenBeatmap.cs | 6 +----- osu.Game/Screens/GameScreenWhiteBox.cs | 3 ++- osu.Game/Screens/Menu/Button.cs | 4 +--- osu.Game/Screens/Menu/ButtonSystem.cs | 2 +- osu.Game/Screens/Play/KeyCounter.cs | 2 +- osu.Game/Screens/Play/PauseOverlay.cs | 2 +- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Select/FilterControl.cs | 3 +-- osu.Game/Screens/Select/Footer.cs | 2 +- osu.Game/Screens/Select/PlaySongSelect.cs | 2 +- osu.Game/Screens/Tournament/Drawings.cs | 5 +---- .../Screens/Tournament/ScrollingTeamContainer.cs | 4 ++-- 30 files changed, 54 insertions(+), 75 deletions(-) diff --git a/osu.Desktop.Deploy/GitHubObject.cs b/osu.Desktop.Deploy/GitHubObject.cs index 258f941340..a91e7273a4 100644 --- a/osu.Desktop.Deploy/GitHubObject.cs +++ b/osu.Desktop.Deploy/GitHubObject.cs @@ -5,7 +5,7 @@ using Newtonsoft.Json; namespace osu.Desktop.Deploy { - internal class GitHubObject + public class GitHubObject { [JsonProperty(@"id")] public int Id; diff --git a/osu.Desktop.Deploy/GitHubRelease.cs b/osu.Desktop.Deploy/GitHubRelease.cs index a621ff2216..fe372a7825 100644 --- a/osu.Desktop.Deploy/GitHubRelease.cs +++ b/osu.Desktop.Deploy/GitHubRelease.cs @@ -5,7 +5,7 @@ using Newtonsoft.Json; namespace osu.Desktop.Deploy { - internal class GitHubRelease + public class GitHubRelease { [JsonProperty(@"id")] public int Id; diff --git a/osu.Desktop/OsuGameDesktop.cs b/osu.Desktop/OsuGameDesktop.cs index d5858b4b2a..3b827f2809 100644 --- a/osu.Desktop/OsuGameDesktop.cs +++ b/osu.Desktop/OsuGameDesktop.cs @@ -76,10 +76,7 @@ namespace osu.Desktop if (isFile) { var paths = ((object[])e.Data.GetData(DataFormats.FileDrop)).Select(f => f.ToString()).ToArray(); - if (allowed_extensions.Any(ext => paths.All(p => p.EndsWith(ext)))) - e.Effect = DragDropEffects.Copy; - else - e.Effect = DragDropEffects.None; + e.Effect = allowed_extensions.Any(ext => paths.All(p => p.EndsWith(ext))) ? DragDropEffects.Copy : DragDropEffects.None; } } } diff --git a/osu.Game.Modes.Mania/UI/ManiaComboCounter.cs b/osu.Game.Modes.Mania/UI/ManiaComboCounter.cs index 753199e9b9..c5ed557854 100644 --- a/osu.Game.Modes.Mania/UI/ManiaComboCounter.cs +++ b/osu.Game.Modes.Mania/UI/ManiaComboCounter.cs @@ -31,7 +31,7 @@ namespace osu.Game.Modes.Mania.UI PopOutCount.Anchor = Anchor.BottomCentre; PopOutCount.Origin = Anchor.Centre; - PopOutCount.FadeColour(PopOutColor, 0); + PopOutCount.FadeColour(PopOutColor); OriginalColour = DisplayedCountSpriteText.Colour; } diff --git a/osu.Game.Modes.Osu/Objects/CircularArcApproximator.cs b/osu.Game.Modes.Osu/Objects/CircularArcApproximator.cs index 3c112576b6..0f6f335279 100644 --- a/osu.Game.Modes.Osu/Objects/CircularArcApproximator.cs +++ b/osu.Game.Modes.Osu/Objects/CircularArcApproximator.cs @@ -79,12 +79,9 @@ namespace osu.Game.Modes.Osu.Objects // We select the amount of points for the approximation by requiring the discrete curvature // to be smaller than the provided tolerance. The exact angle required to meet the tolerance // is: 2 * Math.Acos(1 - TOLERANCE / r) - if (2 * r <= tolerance) - // This special case is required for extremely short sliders where the radius is smaller than - // the tolerance. This is a pathological rather than a realistic case. - amountPoints = 2; - else - amountPoints = Math.Max(2, (int)Math.Ceiling(thetaRange / (2 * Math.Acos(1 - tolerance / r)))); + // The special case is required for extremely short sliders where the radius is smaller than + // the tolerance. This is a pathological rather than a realistic case. + amountPoints = 2 * r <= tolerance ? 2 : Math.Max(2, (int)Math.Ceiling(thetaRange / (2 * Math.Acos(1 - tolerance / r)))); List output = new List(amountPoints); diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs b/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs index e11e0660d5..6ef9bc100a 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Connections/FollowPointRenderer.cs @@ -1,12 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using osu.Game.Modes.Osu.Objects.Drawables.Connections; using System; using System.Collections.Generic; +using OpenTK; -namespace osu.Game.Modes.Osu.Objects.Drawables +namespace osu.Game.Modes.Osu.Objects.Drawables.Connections { public class FollowPointRenderer : ConnectionRenderer { diff --git a/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs b/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs index 0dfd66bc8a..3a8ab00f10 100644 --- a/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs +++ b/osu.Game.Modes.Osu/Objects/OsuHitObjectParser.cs @@ -34,11 +34,11 @@ namespace osu.Game.Modes.Osu.Objects List points = new List { new Vector2(int.Parse(split[0]), int.Parse(split[1])) }; string[] pointsplit = split[5].Split('|'); - for (int i = 0; i < pointsplit.Length; i++) + foreach (string t in pointsplit) { - if (pointsplit[i].Length == 1) + if (t.Length == 1) { - switch (pointsplit[i]) + switch (t) { case @"C": curveType = CurveTypes.Catmull; @@ -56,7 +56,7 @@ namespace osu.Game.Modes.Osu.Objects continue; } - string[] temp = pointsplit[i].Split(':'); + string[] temp = t.Split(':'); Vector2 v = new Vector2( (int)Convert.ToDouble(temp[0], CultureInfo.InvariantCulture), (int)Convert.ToDouble(temp[1], CultureInfo.InvariantCulture) diff --git a/osu.Game/IO/Legacy/SerializationReader.cs b/osu.Game/IO/Legacy/SerializationReader.cs index 79a293a91e..a1c103f052 100644 --- a/osu.Game/IO/Legacy/SerializationReader.cs +++ b/osu.Game/IO/Legacy/SerializationReader.cs @@ -173,9 +173,11 @@ namespace osu.Game.IO.Legacy private static void initialize() { versionBinder = new VersionConfigToNamespaceAssemblyObjectBinder(); - formatter = new BinaryFormatter(); - formatter.AssemblyFormat = FormatterAssemblyStyle.Simple; - formatter.Binder = versionBinder; + formatter = new BinaryFormatter + { + AssemblyFormat = FormatterAssemblyStyle.Simple, + Binder = versionBinder + }; } public static object Deserialize(Stream stream) diff --git a/osu.Game/IO/Legacy/SerializationWriter.cs b/osu.Game/IO/Legacy/SerializationWriter.cs index df5facbc5b..571475b07c 100644 --- a/osu.Game/IO/Legacy/SerializationWriter.cs +++ b/osu.Game/IO/Legacy/SerializationWriter.cs @@ -73,13 +73,16 @@ namespace osu.Game.IO.Legacy } } - /// Writes a DateTime to the buffer. + /// + /// Writes DateTime to the buffer. + /// + /// public void Write(DateTime dt) { Write(dt.ToUniversalTime().Ticks); } - /// Writes a generic ICollection (such as an IList) to the buffer. + /// Writes a generic ICollection (such as an IList(T)) to the buffer. public void Write(List c) where T : ILegacySerializable { if (c == null) @@ -212,9 +215,11 @@ namespace osu.Game.IO.Legacy default: Write((byte)ObjType.otherType); - BinaryFormatter b = new BinaryFormatter(); - b.AssemblyFormat = FormatterAssemblyStyle.Simple; - b.TypeFormat = FormatterTypeStyle.TypesWhenNeeded; + BinaryFormatter b = new BinaryFormatter + { + AssemblyFormat = FormatterAssemblyStyle.Simple, + TypeFormat = FormatterTypeStyle.TypesWhenNeeded + }; b.Serialize(BaseStream, obj); break; } // switch diff --git a/osu.Game/IPC/BeatmapIPCChannel.cs b/osu.Game/IPC/BeatmapIPCChannel.cs index 8c53910146..1d0f4779be 100644 --- a/osu.Game/IPC/BeatmapIPCChannel.cs +++ b/osu.Game/IPC/BeatmapIPCChannel.cs @@ -16,7 +16,7 @@ namespace osu.Game.IPC : base(host) { this.beatmaps = beatmaps; - MessageReceived += (msg) => + MessageReceived += msg => { Debug.Assert(beatmaps != null); ImportAsync(msg.Path); diff --git a/osu.Game/IPC/ScoreIPCChannel.cs b/osu.Game/IPC/ScoreIPCChannel.cs index 289f5454e6..0a49f4cd8f 100644 --- a/osu.Game/IPC/ScoreIPCChannel.cs +++ b/osu.Game/IPC/ScoreIPCChannel.cs @@ -16,10 +16,13 @@ namespace osu.Game.IPC : base(host) { this.scores = scores; - MessageReceived += (msg) => + MessageReceived += msg => { Debug.Assert(scores != null); - ImportAsync(msg.Path); + ImportAsync(msg.Path).ContinueWith(t => + { + if (t.Exception != null) throw t.Exception; + }, TaskContinuationOptions.OnlyOnFaulted); }; } diff --git a/osu.Game/Modes/LegacyReplay.cs b/osu.Game/Modes/LegacyReplay.cs index c7ae0fe31c..9ab6c587a9 100644 --- a/osu.Game/Modes/LegacyReplay.cs +++ b/osu.Game/Modes/LegacyReplay.cs @@ -253,7 +253,7 @@ namespace osu.Game.Modes public void ReadFromStream(SerializationReader sr) { - throw new System.NotImplementedException(); + throw new NotImplementedException(); } public void WriteToStream(SerializationWriter sw) diff --git a/osu.Game/Modes/UI/ComboCounter.cs b/osu.Game/Modes/UI/ComboCounter.cs index ddff98db7c..a549246011 100644 --- a/osu.Game/Modes/UI/ComboCounter.cs +++ b/osu.Game/Modes/UI/ComboCounter.cs @@ -134,19 +134,11 @@ namespace osu.Game.Modes.UI updateCount(Count); } - /// - /// Animates roll-back to 0. - /// - public void Roll() - { - Roll(0); - } - /// /// Animates roll-up/roll-back to an specific value. /// /// Target value. - public virtual void Roll(ulong newValue) + public virtual void Roll(ulong newValue = 0) { updateCount(newValue, true); } diff --git a/osu.Game/Online/API/APIRequest.cs b/osu.Game/Online/API/APIRequest.cs index 3654dac5d5..f871e5e20a 100644 --- a/osu.Game/Online/API/APIRequest.cs +++ b/osu.Game/Online/API/APIRequest.cs @@ -89,5 +89,5 @@ namespace osu.Game.Online.API public delegate void APIFailureHandler(Exception e); public delegate void APISuccessHandler(); - public delegate void APISuccessHandler(T content); + public delegate void APISuccessHandler(T content); } diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index d722eb356a..206ba586dc 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -167,7 +167,7 @@ namespace osu.Game.Overlays.Mods // 1.05x // 1.20x - multiplierLabel.Text = string.Format("{0:N2}x", multiplier); + multiplierLabel.Text = $"{multiplier:N2}x"; string rankedString = ranked ? "Ranked" : "Unranked"; rankedLabel.Text = $@"{rankedString}, Score Multiplier: "; diff --git a/osu.Game/Overlays/Options/OptionDropDown.cs b/osu.Game/Overlays/Options/OptionDropDown.cs index 1878d12d43..0f49abd515 100644 --- a/osu.Game/Overlays/Options/OptionDropDown.cs +++ b/osu.Game/Overlays/Options/OptionDropDown.cs @@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Options bindable.ValueChanged += bindable_ValueChanged; bindable_ValueChanged(null, null); - if (bindable?.Disabled ?? true) + if ((bool)bindable?.Disabled) Alpha = 0.3f; } } diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index 3b83fc4e9a..8b24157381 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -64,11 +64,8 @@ namespace osu.Game.Overlays.Toolbar } }; - int amountButtons = 0; foreach (PlayMode m in Enum.GetValues(typeof(PlayMode))) { - ++amountButtons; - var localMode = m; modeButtons.Add(new ToolbarModeButton { diff --git a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs index ae3d41e374..89af56c18c 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarUserButton.cs @@ -94,11 +94,7 @@ namespace osu.Game.Overlays.Toolbar userId = value; - Sprite newSprite; - if (userId > 1) - newSprite = new OnlineSprite($@"https://a.ppy.sh/{userId}"); - else - newSprite = new Sprite { Texture = guestTexture }; + var newSprite = userId > 1 ? new OnlineSprite($@"https://a.ppy.sh/{userId}") : new Sprite { Texture = guestTexture }; newSprite.FillMode = FillMode.Fit; diff --git a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs index 95a263463a..9c352aad80 100644 --- a/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs +++ b/osu.Game/Screens/Backgrounds/BackgroundScreenBeatmap.cs @@ -30,11 +30,7 @@ namespace osu.Game.Screens.Backgrounds Schedule(() => { - Background newBackground; - if (beatmap == null) - newBackground = new Background(@"Backgrounds/bg1"); - else - newBackground = new BeatmapBackground(beatmap); + var newBackground = beatmap == null ? new Background(@"Backgrounds/bg1") : new BeatmapBackground(beatmap); newBackground.LoadAsync(Game, delegate { diff --git a/osu.Game/Screens/GameScreenWhiteBox.cs b/osu.Game/Screens/GameScreenWhiteBox.cs index 8e93ff3332..b4cbf5a622 100644 --- a/osu.Game/Screens/GameScreenWhiteBox.cs +++ b/osu.Game/Screens/GameScreenWhiteBox.cs @@ -25,7 +25,6 @@ namespace osu.Game.Screens protected virtual IEnumerable PossibleChildren => null; - private FillFlowContainer childModeButtons; private Container textContainer; private Box box; @@ -80,6 +79,8 @@ namespace osu.Game.Screens public ScreenWhiteBox() { + FillFlowContainer childModeButtons; + Children = new Drawable[] { box = new Box diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index 00ad1018fa..023801b6fe 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -234,9 +234,7 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader] private void load(AudioManager audio) { - sampleClick = audio.Sample.Get($@"Menu/menu-{internalName}-click"); - if (sampleClick == null) - sampleClick = audio.Sample.Get(internalName.Contains(@"back") ? @"Menu/menuback" : @"Menu/menuhit"); + sampleClick = audio.Sample.Get($@"Menu/menu-{internalName}-click") ?? audio.Sample.Get(internalName.Contains(@"back") ? @"Menu/menuback" : @"Menu/menuhit"); } protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index bab6e24e96..7903062929 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -19,7 +19,7 @@ using OpenTK.Input; namespace osu.Game.Screens.Menu { - public partial class ButtonSystem : Container, IStateful + public class ButtonSystem : Container, IStateful { public Action OnEdit; public Action OnExit; diff --git a/osu.Game/Screens/Play/KeyCounter.cs b/osu.Game/Screens/Play/KeyCounter.cs index 6888c75d83..20a8f73104 100644 --- a/osu.Game/Screens/Play/KeyCounter.cs +++ b/osu.Game/Screens/Play/KeyCounter.cs @@ -53,7 +53,7 @@ namespace osu.Game.Screens.Play //further: change default values here and in KeyCounterCollection if needed, instead of passing them in every constructor public Color4 KeyDownTextColor { get; set; } = Color4.DarkGray; public Color4 KeyUpTextColor { get; set; } = Color4.White; - public int FadeTime { get; set; } = 0; + public int FadeTime { get; set; } protected KeyCounter(string name) { diff --git a/osu.Game/Screens/Play/PauseOverlay.cs b/osu.Game/Screens/Play/PauseOverlay.cs index 90a8e5dbfc..0f3303fc29 100644 --- a/osu.Game/Screens/Play/PauseOverlay.cs +++ b/osu.Game/Screens/Play/PauseOverlay.cs @@ -50,7 +50,7 @@ namespace osu.Game.Screens.Play }, new OsuSpriteText { - Text = String.Format("{0:n0}", value), + Text = $"{value:n0}", Font = @"Exo2.0-Bold", Shadow = true, ShadowColour = new Color4(0, 0, 0, 0.25f), diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 0026cc12fa..7f45e400f4 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -58,7 +58,7 @@ namespace osu.Game.Screens.Play private PauseOverlay pauseOverlay; [BackgroundDependencyLoader] - private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config) + private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager config) { var beatmap = Beatmap.Beatmap; diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index af47e73788..e20c170e3f 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -9,7 +9,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; @@ -60,7 +59,7 @@ namespace osu.Game.Screens.Select { searchTextBox = new SearchTextBox { RelativeSizeAxes = Axes.X, - OnChange = (TextBox sender, bool newText) => + OnChange = (sender, newText) => { if (newText) FilterChanged?.Invoke(); diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 2bd9e05091..4af72cecd9 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -95,7 +95,7 @@ namespace osu.Game.Screens.Select { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, - Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0), + Position = new Vector2(TwoLayerButton.SIZE_EXTENDED.X + padding, 0), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Direction = FillDirection.Horizontal, diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index c93f61fd6e..86f9bc30cf 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -341,7 +341,7 @@ namespace osu.Game.Screens.Select //todo: change background in selectionChanged instead; support per-difficulty backgrounds. changeBackground(beatmap); - carousel.SelectBeatmap(beatmap?.BeatmapInfo); + carousel.SelectBeatmap(beatmap.BeatmapInfo); } /// diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index f9155bbc2a..61f75021dc 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -267,10 +267,7 @@ namespace osu.Game.Screens.Tournament } }; - if (writeOp == null) - writeOp = Task.Run(writeAction); - else - writeOp = writeOp.ContinueWith(t => { writeAction(); }); + writeOp = writeOp?.ContinueWith(t => { writeAction(); }) ?? Task.Run(writeAction); } private void reloadTeams() diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index a5add07b2e..6479aa3638 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -263,9 +263,9 @@ namespace osu.Game.Screens.Tournament private void addFlags() { - for (int i = 0; i < availableTeams.Count; i++) + foreach (Team t in availableTeams) { - Add(new ScrollingTeam(availableTeams[i]) + Add(new ScrollingTeam(t) { X = leftPos + DrawWidth });