From 7de36b7aa27db5c0c07a75d8516019839c820698 Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Wed, 3 May 2017 12:58:46 +0900 Subject: [PATCH] CI cleanups. --- .../Tests/TestCaseManiaPlayfield.cs | 31 +++++-------------- osu.Game.Rulesets.Mania/UI/Column.cs | 6 ++-- osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs | 8 ++--- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs b/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs index 62abc865a1..4c7433ff5a 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseManiaPlayfield.cs @@ -1,27 +1,12 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; -using osu.Framework.Extensions.Color4Extensions; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Colour; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using osu.Framework.Testing; -using osu.Game.Graphics; -using osu.Framework.Graphics.Primitives; -using osu.Framework.Input; -using OpenTK.Input; -using osu.Game.Rulesets.UI; -using osu.Framework.Allocation; using osu.Framework.Extensions.IEnumerableExtensions; +using osu.Framework.Input; +using osu.Framework.Testing; +using osu.Framework.Graphics; using osu.Game.Rulesets.Mania.UI; +using System.Linq; namespace osu.Desktop.VisualTests.Tests { @@ -35,13 +20,13 @@ namespace osu.Desktop.VisualTests.Tests { base.Reset(); - int max_columns = 9; + const int max_columns = 9; for (int i = 1; i <= max_columns; i++) { int tempI = i; - AddStep($@"{i} column" + (i > 1 ? "s" : ""), () => + AddStep($"{i} column" + (i > 1 ? "s" : ""), () => { Clear(); Add(new ManiaPlayfield(tempI) @@ -51,8 +36,8 @@ namespace osu.Desktop.VisualTests.Tests }); }); - AddStep($"Trigger keys down", () => ((ManiaPlayfield)Children.First()).Columns.Children.ForEach(triggerKeyDown)); - AddStep($"Trigger keys up", () => ((ManiaPlayfield)Children.First()).Columns.Children.ForEach(triggerKeyUp)); + AddStep("Trigger keys down", () => ((ManiaPlayfield)Children.First()).Columns.Children.ForEach(triggerKeyDown)); + AddStep("Trigger keys up", () => ((ManiaPlayfield)Children.First()).Columns.Children.ForEach(triggerKeyUp)); } } diff --git a/osu.Game.Rulesets.Mania/UI/Column.cs b/osu.Game.Rulesets.Mania/UI/Column.cs index 584dfdd09c..75ae529c4c 100644 --- a/osu.Game.Rulesets.Mania/UI/Column.cs +++ b/osu.Game.Rulesets.Mania/UI/Column.cs @@ -56,9 +56,9 @@ namespace osu.Game.Rulesets.Mania.UI public Key Key; - private Box background; - private Container hitTargetBar; - private Container keyIcon; + private readonly Box background; + private readonly Container hitTargetBar; + private readonly Container keyIcon; public Column() { diff --git a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs index 0b7b1df06d..08ac4c4a3b 100644 --- a/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs +++ b/osu.Game.Rulesets.Mania/UI/ManiaPlayfield.cs @@ -25,9 +25,9 @@ namespace osu.Game.Rulesets.Mania.UI public ManiaPlayfield(int columns) { if (columns > 9) - throw new ArgumentException($@"{columns} columns is not supported."); + throw new ArgumentException($"{columns} columns is not supported."); if (columns <= 0) - throw new ArgumentException($@"Can't have zero or fewer columns."); + throw new ArgumentException("Can't have zero or fewer columns."); Children = new Drawable[] { @@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Mania.UI [BackgroundDependencyLoader] private void load(OsuColour colours) { - var columnColours = new Color4[] + Color4[] columnColours = new[] { colours.RedDark, colours.GreenDark, @@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Mania.UI int columnCount = Columns.Children.Count(); int halfColumns = columnCount / 2; - var keys = new Key[] { Key.A, Key.S, Key.D, Key.F, Key.Space, Key.J, Key.K, Key.L, Key.Semicolon }; + Key[] keys = new[] { Key.A, Key.S, Key.D, Key.F, Key.Space, Key.J, Key.K, Key.L, Key.Semicolon }; for (int i = 0; i < halfColumns; i++) {