Skip to content

Commit 92b3735

Browse files
committed
Renamed here some colors to have the "Light" prefix in order to be more easy recognizeable in-Game.
Made "ToColor()" easier.
1 parent 95d8abd commit 92b3735

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

Service/Utils.cs

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,21 @@ public static class Utils
2222
public static readonly DotnetNoise.FastNoise NoiseMaker = new(DateTime.UtcNow.Ticks.GetHashCode());
2323
private static readonly TileColor[] AllTileColors =
2424
{
25-
TileColor.SkyBlue, //--> Hellblau
25+
TileColor.LightBlue, //--> Hellblau
2626
TileColor.Turquoise, //--> Türkis
2727
TileColor.Blue, //--> Blau
28-
TileColor.SpringGreen, //--> Hellgrün
28+
TileColor.LightGreen, //--> Hellgrün
2929
TileColor.Green, //--> Grün
3030
TileColor.Brown, //--> Braun
3131
TileColor.Orange, //--> Orange
3232
TileColor.Yellow, //--> Gelb
3333
TileColor.MediumVioletRed, //--> RotPink
34-
TileColor.BlueViolet, //--> Rosa
34+
TileColor.Purple, //--> Rosa
3535
TileColor.Magenta, //--> Pink
3636
TileColor.Red, //--> Rot
3737

3838
};
39+
3940
private static CellBlock EntireGrid
4041
{
4142
get
@@ -49,6 +50,7 @@ private static CellBlock EntireGrid
4950
return block;
5051
}
5152
}
53+
5254
public static Vector2 GetScreen() => EntireGrid.End;
5355

5456
public static Vector4 ToVec4(this Color color)
@@ -80,31 +82,23 @@ public static int ToIndex(this TileColor color)
8082
{
8183
return color switch
8284
{
83-
TileColor.SkyBlue => 0, //--> Hellblau
84-
TileColor.Turquoise => 1, //--> Dunkelblau
85-
TileColor.Blue => 2, //--> Blau
86-
TileColor.SpringGreen =>3, //--> Hellgrün
87-
TileColor.Green => 4, //--> Grün
88-
TileColor.Brown => 5, //--> Braun
89-
TileColor.Orange => 6, //--> Orange
90-
TileColor.Yellow => 7, //--> Gelb
91-
TileColor.MediumVioletRed => 8, //--> RotPink
92-
TileColor.BlueViolet => 9, //--> Rosa
93-
TileColor.Magenta => 10, //--> Pink
85+
TileColor.LightBlue => 0, //--> Hellblau
86+
TileColor.Turquoise => 1, //--> Dunkelblau
87+
TileColor.Blue => 2, //--> Blau
88+
TileColor.LightGreen =>3, //--> Hellgrün
89+
TileColor.Green => 4, //--> Grün
90+
TileColor.Brown => 5, //--> Braun
91+
TileColor.Orange => 6, //--> Orange
92+
TileColor.Yellow => 7, //--> Gelb
93+
TileColor.MediumVioletRed => 8, //--> RotPink
94+
TileColor.Purple => 9, //--> Rosa
95+
TileColor.Magenta => 10, //--> Pink
9496
TileColor.Red => 11,
9597
_ => throw new ArgumentOutOfRangeException(nameof(color), color, "No other color is senseful since we do not need other or more colors!")
9698
};
9799
}
98100

99-
public static TileColor ToColor(this int color)
100-
{
101-
if (color < Config.TileColorCount)
102-
{
103-
return AllTileColors[color];
104-
}
105-
106-
throw new IndexOutOfRangeException(nameof(color));
107-
}
101+
public static TileColor ToColor(this int color) => AllTileColors[color];
108102

109103
//nested helper functions!
110104
public static Span<char> AsSpan(this StringBuilder self)

0 commit comments

Comments
 (0)