diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ColorGame6x4AnalyzerTests.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ColorGame6x4AnalyzerTests.cs index 2428bc5a..61a24961 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ColorGame6x4AnalyzerTests.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ColorGame6x4AnalyzerTests.cs @@ -1,10 +1,5 @@ using System.Collections; -using Codebreaker.GameAPIs.Algorithms.Fields; -using Codebreaker.GameAPIs.Analyzers; -using Codebreaker.GameAPIs.Algorithms.Extensions; -using Codebreaker.GameAPIs.Models; - using static Codebreaker.GameAPIs.Models.Colors; namespace Codebreaker.GameAPIs.Algorithms.Tests; diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ColorGame8x5AnalyzerTests.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ColorGame8x5AnalyzerTests.cs index 557b75eb..65dc0b2a 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ColorGame8x5AnalyzerTests.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ColorGame8x5AnalyzerTests.cs @@ -1,9 +1,6 @@ using System.Collections; -using Codebreaker.GameAPIs.Algorithms.Extensions; -using Codebreaker.GameAPIs.Algorithms.Fields; using Codebreaker.GameAPIs.Analyzers; -using Codebreaker.GameAPIs.Models; using static Codebreaker.GameAPIs.Models.Colors; diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ShapeGame5x5x4AnalyzerTests.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ShapeGame5x5x4AnalyzerTests.cs index 17f08bc6..e4fbb65a 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ShapeGame5x5x4AnalyzerTests.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Analyzers/ShapeGame5x5x4AnalyzerTests.cs @@ -1,9 +1,6 @@ using System.Collections; -using Codebreaker.GameAPIs.Algorithms.Extensions; -using Codebreaker.GameAPIs.Algorithms.Fields; using Codebreaker.GameAPIs.Analyzers; -using Codebreaker.GameAPIs.Models; using static Codebreaker.GameAPIs.Models.Colors; using static Codebreaker.GameAPIs.Models.Shapes; diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/MockColorGame.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/MockColorGame.cs index f3f9511e..87dbcfb4 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/MockColorGame.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/MockColorGame.cs @@ -1,6 +1,4 @@ -using Codebreaker.GameAPIs.Contracts; - -namespace Codebreaker.GameAPIs.Algorithms.Tests; +namespace Codebreaker.GameAPIs.Algorithms.Tests; public class MockColorGame : IGame { diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/MockShapeGame.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/MockShapeGame.cs index 255c4a9f..d3742d96 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/MockShapeGame.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/MockShapeGame.cs @@ -1,6 +1,4 @@ -using Codebreaker.GameAPIs.Contracts; - -namespace Codebreaker.GameAPIs.Algorithms.Tests; +namespace Codebreaker.GameAPIs.Algorithms.Tests; public class MockShapeGame : IGame { diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Usings.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Usings.cs index 8c927eb7..5d0b2673 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Usings.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers.Tests/Usings.cs @@ -1 +1,6 @@ -global using Xunit; \ No newline at end of file +global using Codebreaker.GameAPIs.Analyzers; +global using Codebreaker.GameAPIs.Contracts; +global using Codebreaker.GameAPIs.Extensions; +global using Codebreaker.GameAPIs.Models; + +global using Xunit; diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/ColorGameGuessAnalyzer.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/ColorGameGuessAnalyzer.cs index 8ecce26a..de69d464 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/ColorGameGuessAnalyzer.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/ColorGameGuessAnalyzer.cs @@ -1,9 +1,4 @@ -using Codebreaker.GameAPIs.Algorithms.Fields; -using Codebreaker.GameAPIs.Contracts; -using Codebreaker.GameAPIs.Models; -using Codebreaker.GameAPIs.Algorithms.Extensions; - -namespace Codebreaker.GameAPIs.Analyzers; +namespace Codebreaker.GameAPIs.Analyzers; public class ColorGameGuessAnalyzer : GameGuessAnalyzer { diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/GameGuessAnalyzer.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/GameGuessAnalyzer.cs index 7d6e82bb..88a6b6c8 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/GameGuessAnalyzer.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/GameGuessAnalyzer.cs @@ -1,6 +1,4 @@ -using Codebreaker.GameAPIs.Contracts; - -namespace Codebreaker.GameAPIs.Analyzers; +namespace Codebreaker.GameAPIs.Analyzers; /// /// Abstract base class for game guess analyzers. diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/ShapeGameGuessAnalyzer.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/ShapeGameGuessAnalyzer.cs index d5ad1281..7ce0d49d 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/ShapeGameGuessAnalyzer.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/ShapeGameGuessAnalyzer.cs @@ -1,9 +1,4 @@ -using Codebreaker.GameAPIs.Algorithms.Extensions; -using Codebreaker.GameAPIs.Algorithms.Fields; -using Codebreaker.GameAPIs.Contracts; -using Codebreaker.GameAPIs.Models; - -namespace Codebreaker.GameAPIs.Analyzers; +namespace Codebreaker.GameAPIs.Analyzers; public class ShapeGameGuessAnalyzer : GameGuessAnalyzer { @@ -79,8 +74,8 @@ protected override ShapeAndColorResult GetCoreResult() // check white (either the shape or the color is correct on a wrong position) for (int i = 0; i < guessPegsToCheck.Count; i++) { - var colorCodes = codesToCheck.Select(c => c.Color).ToArray(); - var shapeCodes = codesToCheck.Select(c => c.Shape).ToArray(); + string[] colorCodes = codesToCheck.Select(c => c.Color).ToArray(); + string[] shapeCodes = codesToCheck.Select(c => c.Shape).ToArray(); if (colorCodes.Contains(guessPegsToCheck[i].Color) || shapeCodes.Contains(guessPegsToCheck[i].Shape)) { diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/SimpleGameGuessAnalyzer.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/SimpleGameGuessAnalyzer.cs index dba72dc6..d3a04c46 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/SimpleGameGuessAnalyzer.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Analyzers/SimpleGameGuessAnalyzer.cs @@ -1,9 +1,4 @@ -using Codebreaker.GameAPIs.Algorithms.Extensions; -using Codebreaker.GameAPIs.Algorithms.Fields; -using Codebreaker.GameAPIs.Contracts; -using Codebreaker.GameAPIs.Models; - -namespace Codebreaker.GameAPIs.Analyzers; +namespace Codebreaker.GameAPIs.Analyzers; public class SimpleGameGuessAnalyzer : GameGuessAnalyzer { diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Extensions/FieldExtensions.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Extensions/FieldExtensions.cs index 62a5501f..f165987b 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Extensions/FieldExtensions.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Extensions/FieldExtensions.cs @@ -1,10 +1,11 @@ namespace Codebreaker.GameAPIs.Extensions; + public static class FieldExtensions { public static IEnumerable ToFields(this string[] fieldStrings) where T : IParsable { - foreach (var fieldString in fieldStrings) + foreach (string fieldString in fieldStrings) { yield return T.Parse(fieldString, default); } diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Extensions/PegExtensions.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Extensions/PegExtensions.cs index 29bdfff2..3bcaf70d 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Extensions/PegExtensions.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Extensions/PegExtensions.cs @@ -1,13 +1,11 @@ -using Codebreaker.GameAPIs.Extensions; -using Codebreaker.GameAPIs.Models; +namespace Codebreaker.GameAPIs.Extensions; -namespace Codebreaker.GameAPIs.Algorithms.Extensions; public static class PegExtensions { public static IEnumerable ToPegs(this string[] pegStrings) where T : IParsable { - foreach (var pegString in pegStrings) + foreach (string pegString in pegStrings) { yield return T.Parse(pegString, default); } diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Fields/FieldCategories.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Fields/FieldCategories.cs index 0616b42b..6df24f89 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Fields/FieldCategories.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Fields/FieldCategories.cs @@ -1,4 +1,5 @@ -namespace Codebreaker.GameAPIs.Algorithms.Fields; +namespace Codebreaker.GameAPIs.Models; + public class FieldCategories { public const string Colors = "colors"; diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Results/ColorResult_ISpanFormattable.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Results/ColorResult_ISpanFormattable.cs index 1e83eb02..e76a0ce7 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Results/ColorResult_ISpanFormattable.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Results/ColorResult_ISpanFormattable.cs @@ -1,4 +1,5 @@ namespace Codebreaker.GameAPIs.Models; + public readonly partial record struct ColorResult : ISpanFormattable { public override string ToString() => ToString(default, default); diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Results/SimpleColorResult_Equality.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Results/SimpleColorResult_Equality.cs index 0032f689..ef2a85de 100644 --- a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Results/SimpleColorResult_Equality.cs +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Results/SimpleColorResult_Equality.cs @@ -1,4 +1,5 @@ namespace Codebreaker.GameAPIs.Models; + public readonly partial struct SimpleColorResult : IEquatable { public override bool Equals(object? obj) diff --git a/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Usings.cs b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Usings.cs new file mode 100644 index 00000000..5e9cfd6a --- /dev/null +++ b/src/services/gameapi/Codebreaker.GameAPIs.Analyzers/Usings.cs @@ -0,0 +1,3 @@ +global using Codebreaker.GameAPIs.Contracts; +global using Codebreaker.GameAPIs.Extensions; +global using Codebreaker.GameAPIs.Models;