fix(core): Moves map definitions and cleans up loading maps, regions, and tiles (#431)

- [X] Moves map definitions to a `map-definitions.json` file.
- [X] Creates a TileMatrixLoader.
- [X] Moves tile matrix and multi data configurations closer to their classes.
This commit is contained in:
Kamron Batman 2021-01-25 11:05:52 -08:00 • committed by GitHub
parent 8580139544
commit 07751654b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 290 additions and 76 deletions

View file

@ -22,9 +22,9 @@ using Server.Utilities;
namespace Server
{
public static class RegionLoader
internal static class RegionLoader
{
public static void LoadRegions()
internal static void LoadRegions()
{
var path = Path.Join(Core.BaseDirectory, "Data/regions.json");
@ -53,20 +53,21 @@ namespace Server
stopwatch.Stop();
Console.ForegroundColor = failures.Count > 0 ? ConsoleColor.Yellow : ConsoleColor.Green;
Console.Write("done{0}. ", failures.Count > 0 ? " with failures" : "");
Console.ResetColor();
Utility.PushColor(failures.Count > 0 ? ConsoleColor.Yellow : ConsoleColor.Green);
Console.Write(failures.Count > 0 ? "done with failures" : "done");
Utility.PopColor();
Console.WriteLine(
"({0} regions, {1} failures) ({2:F2} seconds)",
" ({0} regions, {1} failures) ({2:F2} seconds)",
count,
failures.Count,
stopwatch.Elapsed.TotalSeconds
);
if (failures.Count > 0)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(string.Join("\n", failures));
Console.ResetColor();
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine(string.Join(Environment.NewLine, failures));
Utility.PopColor();
}
}
}