Apply csharpier reflow across source tree
Reformats the entire Craftimizer source tree with dotnet csharpier 1.2.6 to match the Hellion Forge house style (matches what HellionChat enforces in its pre-push pipeline). Pure whitespace + using-block sorting; no semantic changes. This is a one-time noisy commit. Future code edits in this fork should land csharpier-clean because the pre-push hook (introduced in the next commit) runs `dotnet csharpier check Craftimizer/` as Block C of the preflight gate. Trade-off acknowledged: this widens the merge gap with upstream Craftimizer should Asriel ever resume maintenance. Given the upstream has been dormant since FFXIV 7.4 and the fork is light-rename only (internal namespaces unchanged), the marginal cost is acceptable.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
using Craftimizer.Plugin;
|
||||
using Lumina.Excel.Sheets;
|
||||
using System.Collections.Frozen;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using Craftimizer.Plugin;
|
||||
using Lumina.Excel.Sheets;
|
||||
|
||||
namespace Craftimizer.Utils;
|
||||
|
||||
@@ -15,8 +15,20 @@ public static class FoodStatus
|
||||
private static readonly ImmutableArray<uint> FoodOrder;
|
||||
private static readonly ImmutableArray<uint> MedicineOrder;
|
||||
|
||||
public readonly record struct FoodStat(bool IsRelative, int Value, int Max, int ValueHQ, int MaxHQ);
|
||||
public readonly record struct Food(Item Item, FoodStat? Craftsmanship, FoodStat? Control, FoodStat? CP);
|
||||
public readonly record struct FoodStat(
|
||||
bool IsRelative,
|
||||
int Value,
|
||||
int Max,
|
||||
int ValueHQ,
|
||||
int MaxHQ
|
||||
);
|
||||
|
||||
public readonly record struct Food(
|
||||
Item Item,
|
||||
FoodStat? Craftsmanship,
|
||||
FoodStat? Control,
|
||||
FoodStat? CP
|
||||
);
|
||||
|
||||
static FoodStatus()
|
||||
{
|
||||
@@ -39,18 +51,33 @@ public static class FoodStatus
|
||||
if (LuminaSheets.ItemFoodSheet.GetRowOrDefault(itemAction.Data[1]) is not { } itemFood)
|
||||
continue;
|
||||
|
||||
FoodStat? craftsmanship = null, control = null, cp = null;
|
||||
FoodStat? craftsmanship = null,
|
||||
control = null,
|
||||
cp = null;
|
||||
foreach (var stat in itemFood.Params)
|
||||
{
|
||||
if (stat.BaseParam.RowId == 0)
|
||||
continue;
|
||||
var foodStat = new FoodStat(stat.IsRelative, stat.Value, stat.Max, stat.ValueHQ, stat.MaxHQ);
|
||||
var foodStat = new FoodStat(
|
||||
stat.IsRelative,
|
||||
stat.Value,
|
||||
stat.Max,
|
||||
stat.ValueHQ,
|
||||
stat.MaxHQ
|
||||
);
|
||||
switch (stat.BaseParam.RowId)
|
||||
{
|
||||
case Gearsets.ParamCraftsmanship: craftsmanship = foodStat; break;
|
||||
case Gearsets.ParamControl: control = foodStat; break;
|
||||
case Gearsets.ParamCP: cp = foodStat; break;
|
||||
default: continue;
|
||||
case Gearsets.ParamCraftsmanship:
|
||||
craftsmanship = foodStat;
|
||||
break;
|
||||
case Gearsets.ParamControl:
|
||||
control = foodStat;
|
||||
break;
|
||||
case Gearsets.ParamCP:
|
||||
cp = foodStat;
|
||||
break;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,14 +97,23 @@ public static class FoodStatus
|
||||
FoodItems = foods.ToFrozenDictionary();
|
||||
MedicineItems = medicines.ToFrozenDictionary();
|
||||
|
||||
FoodOrder = [.. FoodItems.OrderByDescending(a => a.Value.Item.LevelItem.RowId).Select(a => a.Key)];
|
||||
MedicineOrder = [.. MedicineItems.OrderByDescending(a => a.Value.Item.LevelItem.RowId).Select(a => a.Key)];
|
||||
FoodOrder =
|
||||
[
|
||||
.. FoodItems.OrderByDescending(a => a.Value.Item.LevelItem.RowId).Select(a => a.Key),
|
||||
];
|
||||
MedicineOrder =
|
||||
[
|
||||
.. MedicineItems
|
||||
.OrderByDescending(a => a.Value.Item.LevelItem.RowId)
|
||||
.Select(a => a.Key),
|
||||
];
|
||||
}
|
||||
|
||||
public static void Initialize() { }
|
||||
|
||||
public static IEnumerable<Food> OrderedFoods => FoodOrder.Select(id => FoodItems[id]);
|
||||
public static IEnumerable<Food> OrderedMedicines => MedicineOrder.Select(id => MedicineItems[id]);
|
||||
public static IEnumerable<Food> OrderedMedicines =>
|
||||
MedicineOrder.Select(id => MedicineItems[id]);
|
||||
|
||||
public static (uint ItemId, bool IsHQ)? ResolveFoodParam(ushort param)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user