Remove redundant log bits

This commit is contained in:
Liza 2024-01-25 08:36:43 +01:00
parent 451317f3d2
commit 89239ecf32
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 6 additions and 8 deletions

View File

@ -9,13 +9,11 @@ namespace Workshoppa.GameData;
public sealed class RecipeTree public sealed class RecipeTree
{ {
private readonly IDataManager _dataManager; private readonly IDataManager _dataManager;
private readonly IPluginLog _pluginLog;
private readonly IReadOnlyList<uint> _shopItemsOnly; private readonly IReadOnlyList<uint> _shopItemsOnly;
public RecipeTree(IDataManager dataManager, IPluginLog pluginLog) public RecipeTree(IDataManager dataManager)
{ {
_dataManager = dataManager; _dataManager = dataManager;
_pluginLog = pluginLog;
// probably incomplete, e.g. different housing districts have different shop types // probably incomplete, e.g. different housing districts have different shop types
var shopVendorIds = new uint[] var shopVendorIds = new uint[]
@ -68,10 +66,10 @@ public sealed class RecipeTree
// if a recipe has a specific amount crafted, divide the gathered amount by it // if a recipe has a specific amount crafted, divide the gathered amount by it
foreach (var ingredient in completeList.Where(x => x is { AmountCrafted: > 1 })) foreach (var ingredient in completeList.Where(x => x is { AmountCrafted: > 1 }))
{ {
_pluginLog.Information($"Fudging {ingredient.Name}"); //_pluginLog.Information($"Fudging {ingredient.Name}");
foreach (var part in completeList.Where(x => ingredient.DependsOn.Contains(x.ItemId))) foreach (var part in completeList.Where(x => ingredient.DependsOn.Contains(x.ItemId)))
{ {
_pluginLog.Information($" → {part.Name}"); //_pluginLog.Information($" → {part.Name}");
int unmodifiedQuantity = part.TotalQuantity; int unmodifiedQuantity = part.TotalQuantity;
int roundedQuantity = (int)((unmodifiedQuantity + ingredient.AmountCrafted - 1) / ingredient.AmountCrafted); int roundedQuantity = (int)((unmodifiedQuantity + ingredient.AmountCrafted - 1) / ingredient.AmountCrafted);
@ -102,7 +100,7 @@ public sealed class RecipeTree
List<RecipeInfo> ingredients = new(); List<RecipeInfo> ingredients = new();
foreach (var material in materials.Where(x => x.Type == Ingredient.EType.Craftable)) foreach (var material in materials.Where(x => x.Type == Ingredient.EType.Craftable))
{ {
_pluginLog.Information($"Looking up recipe for {material.Name}"); //_pluginLog.Information($"Looking up recipe for {material.Name}");
var recipe = GetFirstRecipeForItem(material.ItemId); var recipe = GetFirstRecipeForItem(material.ItemId);
if (recipe == null) if (recipe == null)
@ -119,7 +117,7 @@ public sealed class RecipeTree
Recipe? ingredientRecipe = GetFirstRecipeForItem((uint)ingredient.ItemIngredient); Recipe? ingredientRecipe = GetFirstRecipeForItem((uint)ingredient.ItemIngredient);
_pluginLog.Information($"Adding {item.Name}"); //_pluginLog.Information($"Adding {item.Name}");
ingredients.Add(new RecipeInfo ingredients.Add(new RecipeInfo
{ {
ItemId = (uint)ingredient.ItemIngredient, ItemId = (uint)ingredient.ItemIngredient,

View File

@ -71,7 +71,7 @@ public sealed partial class WorkshopPlugin : IDalamudPlugin
_gameStrings = new(dataManager, _pluginLog); _gameStrings = new(dataManager, _pluginLog);
_mainWindow = new(this, _pluginInterface, _clientState, _configuration, _workshopCache, _mainWindow = new(this, _pluginInterface, _clientState, _configuration, _workshopCache,
new IconCache(textureProvider), _chatGui, new RecipeTree(dataManager, _pluginLog), _pluginLog); new IconCache(textureProvider), _chatGui, new RecipeTree(dataManager), _pluginLog);
_windowSystem.AddWindow(_mainWindow); _windowSystem.AddWindow(_mainWindow);
_configWindow = new(_pluginInterface, _configuration); _configWindow = new(_pluginInterface, _configuration);
_windowSystem.AddWindow(_configWindow); _windowSystem.AddWindow(_configWindow);