From c73f832d620cb70e4edaff43655ffb0a47982037 Mon Sep 17 00:00:00 2001 From: TSR Berry <20988865+TSRBerry@users.noreply.github.com> Date: Fri, 22 May 2026 22:14:00 +0200 Subject: [PATCH] Fix code style issues --- NHSE.Core/Structures/Item/ItemClothGroup.cs | 3 ++- NHSE.Core/Structures/Item/ItemInfo.cs | 6 +----- NHSE.Parsing/GameBCSVDumper.cs | 16 +++++----------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/NHSE.Core/Structures/Item/ItemClothGroup.cs b/NHSE.Core/Structures/Item/ItemClothGroup.cs index fdcc50e..27e7a30 100644 --- a/NHSE.Core/Structures/Item/ItemClothGroup.cs +++ b/NHSE.Core/Structures/Item/ItemClothGroup.cs @@ -1476,7 +1476,8 @@ public enum ItemClothGroup : ushort public static class ItemClothGroupExtensions { - private static readonly HashSet SortedByColorGroup = [ + private static readonly HashSet SortedByColorGroup = + [ TopsTexTopOuterLDownjacketBlue, TopsTexTopTshirtsHSailor, TopsTexOnepieceBalloonHHoodRed, diff --git a/NHSE.Core/Structures/Item/ItemInfo.cs b/NHSE.Core/Structures/Item/ItemInfo.cs index 3b19718..674699a 100644 --- a/NHSE.Core/Structures/Item/ItemInfo.cs +++ b/NHSE.Core/Structures/Item/ItemInfo.cs @@ -21,9 +21,7 @@ public static class ItemInfo public static byte GetItemSortOrderIndex(ushort id) { if (id > ItemSortOrder.Length) - { return byte.MaxValue; - } return ItemSortOrder[id]; } @@ -33,11 +31,9 @@ public static byte GetItemSortOrderIndex(ushort id) public static ItemClothGroup GetItemClothGroup(ushort id) { if (id > ItemClothGroups.Length) - { return ItemClothGroup.Unknown; - } - return (ItemClothGroup) ItemClothGroups[id]; + return (ItemClothGroup)ItemClothGroups[id]; } public static ItemKind GetItemKind(Item item) => GetItemKind(item.DisplayItemId); diff --git a/NHSE.Parsing/GameBCSVDumper.cs b/NHSE.Parsing/GameBCSVDumper.cs index 985869d..2d46bac 100644 --- a/NHSE.Parsing/GameBCSVDumper.cs +++ b/NHSE.Parsing/GameBCSVDumper.cs @@ -780,7 +780,7 @@ public static IEnumerable GetItemRemakeColors(string pathBCSV, string fn var fid = dict[0xFD9AF1E1]; // ItemUniqueID //var fct = dict[0x29ECB129]; // RemakeKitNum var rid = dict[0x54706054]; // UniqueID - // var unk = dict[0xD4F43B0B]; // + // var unk = dict[0xD4F43B0B]; // var b00 = dict[0x1B98FDF8]; // ReBodyPattern0Color0 var b01 = dict[0xA3249A9D]; // ReBodyPattern0Color1 var b10 = dict[0xF45A96C6]; // ReBodyPattern1Color0 @@ -865,7 +865,7 @@ public static ushort[] GetItemClothGroupArray(string pathBCSV, string fn = "Item var clothGroups = new Dictionary(); ushort max = 0; - for (int i = 0; i < bcsv.EntryCount; i++) + for (var i = 0; i < bcsv.EntryCount; i++) { var id = bcsv.ReadValue(i, fID); var ival = ushort.Parse(id); @@ -882,7 +882,7 @@ public static ushort[] GetItemClothGroupArray(string pathBCSV, string fn = "Item max = ival; } - ushort[] result = new ushort[max + 1]; + var result = new ushort[max + 1]; foreach (var kvp in clothGroups) result[kvp.Key] = (ushort)kvp.Value; @@ -899,7 +899,7 @@ public static List GetColorGroupSortList(string pathBCSV, string fn = "I var result = new List(); - for (int i = 0; i < bcsv.EntryCount; i++) + for (var i = 0; i < bcsv.EntryCount; i++) { var label = bcsv.ReadValue(i, fLabel).TrimEnd('\0'); var useColorGroupSort = bcsv.ReadValue(i, fUseColorGroupSort); @@ -926,7 +926,7 @@ public static byte[] GetItemSortOrderArray(string pathBCSV, string fn = "ItemPar var itemSortOrder = new Dictionary(); var sortedClothGroups = new Dictionary>>(); ushort max = 0; - for (int i = 0; i < bcsv.EntryCount; i++) + for (var i = 0; i < bcsv.EntryCount; i++) { var id = bcsv.ReadValue(i, fID); var ival = ushort.Parse(id); @@ -961,9 +961,7 @@ public static byte[] GetItemSortOrderArray(string pathBCSV, string fn = "ItemPar } foreach (var kvp in sortedClothGroups) - { WriteSortOrder(kvp.Value, kvp.Key.UsesColorGroupSort); - } byte[] result = new byte[max + 1]; foreach (var kvp in itemSortOrder) @@ -975,9 +973,7 @@ void WriteSortOrder(Dictionary kvp.Value.Item3).Select(kvp => kvp.Key).ToArray(); - } else { sortedItems = items @@ -987,9 +983,7 @@ void WriteSortOrder(Dictionary