Fix code style issues

This commit is contained in:
TSR Berry
2026-05-22 22:14:00 +02:00
parent 263d0e2eb4
commit c73f832d62
3 changed files with 8 additions and 17 deletions

View File

@@ -1476,7 +1476,8 @@ public enum ItemClothGroup : ushort
public static class ItemClothGroupExtensions
{
private static readonly HashSet<ItemClothGroup> SortedByColorGroup = [
private static readonly HashSet<ItemClothGroup> SortedByColorGroup =
[
TopsTexTopOuterLDownjacketBlue,
TopsTexTopTshirtsHSailor,
TopsTexOnepieceBalloonHHoodRed,

View File

@@ -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);

View File

@@ -780,7 +780,7 @@ public static IEnumerable<string> 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, ItemClothGroup>();
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<string> GetColorGroupSortList(string pathBCSV, string fn = "I
var result = new List<string>();
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<ushort, byte>();
var sortedClothGroups = new Dictionary<ItemClothGroup, Dictionary<ushort, Tuple<ItemColorOrder, ItemColorOrder, byte>>>();
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<ushort, Tuple<ItemColorOrder, ItemColorOrder, byt
{
ushort[] sortedItems;
if (usesColorGroupSort)
{
sortedItems = items.OrderBy(kvp => kvp.Value.Item3).Select(kvp => kvp.Key).ToArray();
}
else
{
sortedItems = items
@@ -987,9 +983,7 @@ void WriteSortOrder(Dictionary<ushort, Tuple<ItemColorOrder, ItemColorOrder, byt
}
for (byte i = 0; i < sortedItems.Length; i++)
{
itemSortOrder.Add(sortedItems[i], i);
}
}
}
}