From 2457eb8bd8d7d43e0e43282900f0d12cf9ab1a62 Mon Sep 17 00:00:00 2001 From: Alex <15199219+muskit@users.noreply.github.com> Date: Mon, 1 Sep 2025 15:01:53 -0700 Subject: [PATCH] refactor consts --- src/Data/Song/Consts.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Data/Song/Consts.cs b/src/Data/Song/Consts.cs index 7ef3ee8..a0130e3 100644 --- a/src/Data/Song/Consts.cs +++ b/src/Data/Song/Consts.cs @@ -7,7 +7,7 @@ namespace MercuryConverter.Data; public static class Consts { - private static Dictionary _CATEGORY_INDEX = new() + public static readonly IReadOnlyDictionary CATEGORY_INDEX = new Dictionary { { -1, "Unknown"}, { 0, "Anime/Pop"}, @@ -19,9 +19,8 @@ public static class Consts { 6, "HARDCORE TANO*C" }, { 7, "VTuber" }, }; - public static readonly IReadOnlyDictionary CATEGORY_INDEX = _CATEGORY_INDEX; - private static Dictionary _NUM_SOURCE = new() + public static readonly IReadOnlyDictionary NUM_SOURCE = new Dictionary { { 1, string.Concat(new int[] {87, 65, 67, 67, 65}.Select(i => Convert.ToChar(i))) }, { 2, string.Concat(new int[] {87, 65, 67, 67, 65, 32, 83}.Select(i => Convert.ToChar(i))) }, @@ -29,35 +28,31 @@ public static class Consts { 4, string.Concat(new int[] {87, 65, 67, 67, 65, 32, 76, 73, 76, 89, 32, 82}.Select(i => Convert.ToChar(i))) }, { 5, string.Concat(new int[] {87, 65, 67, 67, 65, 32, 82, 101, 118, 101, 114, 115, 101}.Select(i => Convert.ToChar(i))) } }; - public static readonly IReadOnlyDictionary NUM_SOURCE = _NUM_SOURCE; - public static readonly IReadOnlyDictionary SOURCE_NUM = _NUM_SOURCE.ToDictionary(p => p.Value, p => p.Key); + public static readonly IReadOnlyDictionary SOURCE_NUM = NUM_SOURCE.ToDictionary(p => p.Value, p => p.Key); - private static readonly Dictionary _DIFF_LVL_KEY = new() + public static readonly IReadOnlyDictionary DIFF_LVL_KEY = new Dictionary { {Difficulty.Normal, "DifficultyNormalLv"}, {Difficulty.Hard, "DifficultyHardLv"}, {Difficulty.Expert, "DifficultyExtremeLv"}, {Difficulty.Inferno, "DifficultyInfernoLv"}, }; - public static readonly IReadOnlyDictionary DIFF_LVL_KEY = _DIFF_LVL_KEY; - private static readonly Dictionary _DIFF_FILENAME_APPEND = new() + public static readonly IReadOnlyDictionary DIFF_FILENAME_APPEND = new Dictionary { {Difficulty.Normal, "00"}, {Difficulty.Hard, "01"}, {Difficulty.Expert, "02"}, {Difficulty.Inferno, "03"}, }; - public static readonly IReadOnlyDictionary DIFF_FILENAME_APPEND = _DIFF_FILENAME_APPEND; - private static readonly Dictionary _DIFF_CLEAR_KEY = new() + public static readonly IReadOnlyDictionary DIFF_CLEAR_KEY = new Dictionary { {Difficulty.Normal, "ClearNormaRateNormal"}, {Difficulty.Hard, "ClearNormaRateHard"}, {Difficulty.Expert, "ClearNormaRateExtreme"}, {Difficulty.Inferno, "ClearNormaRateInferno"}, }; - public static readonly IReadOnlyDictionary DIFF_CLEAR_KEY = _DIFF_CLEAR_KEY; public static readonly IReadOnlyDictionary DIFF_DESIGNER_KEY = new Dictionary() {