From 72c2858caee10c121606c33331c67af0943af5dd Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Sun, 14 Jul 2024 16:17:08 +0200 Subject: [PATCH] Code cleanup --- .../CombatModules/RotationSolverRebornModule.cs | 2 ++ .../Controller/Steps/Interactions/AethernetShard.cs | 2 +- .../Controller/Steps/Interactions/EquipItem.cs | 12 +++++------- Questionable/Data/AetherCurrentData.cs | 3 +-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Questionable/Controller/CombatModules/RotationSolverRebornModule.cs b/Questionable/Controller/CombatModules/RotationSolverRebornModule.cs index 23e94b36..d1a2bb92 100644 --- a/Questionable/Controller/CombatModules/RotationSolverRebornModule.cs +++ b/Questionable/Controller/CombatModules/RotationSolverRebornModule.cs @@ -5,6 +5,7 @@ using Dalamud.Plugin; using Dalamud.Plugin.Ipc; using Dalamud.Plugin.Ipc.Exceptions; using Dalamud.Plugin.Services; +using JetBrains.Annotations; using Microsoft.Extensions.Logging; using Questionable.Model; @@ -89,6 +90,7 @@ internal sealed class RotationSolverRebornModule : ICombatModule, IDisposable public void Dispose() => Stop(); + [PublicAPI] enum StateCommandType : byte { Off, diff --git a/Questionable/Controller/Steps/Interactions/AethernetShard.cs b/Questionable/Controller/Steps/Interactions/AethernetShard.cs index 5177c078..ec3969c9 100644 --- a/Questionable/Controller/Steps/Interactions/AethernetShard.cs +++ b/Questionable/Controller/Steps/Interactions/AethernetShard.cs @@ -28,7 +28,7 @@ internal static class AethernetShard { public EAetheryteLocation AetheryteLocation { get; set; } - public ITask? With(EAetheryteLocation aetheryteLocation) + public ITask With(EAetheryteLocation aetheryteLocation) { AetheryteLocation = aetheryteLocation; return this; diff --git a/Questionable/Controller/Steps/Interactions/EquipItem.cs b/Questionable/Controller/Steps/Interactions/EquipItem.cs index 65147b68..6a6157a8 100644 --- a/Questionable/Controller/Steps/Interactions/EquipItem.cs +++ b/Questionable/Controller/Steps/Interactions/EquipItem.cs @@ -90,20 +90,20 @@ internal static class EquipItem return ETaskResult.StillRunning; } - private unsafe bool Equip() + private unsafe void Equip() { var inventoryManager = InventoryManager.Instance(); if (inventoryManager == null) - return false; + return; var equippedContainer = inventoryManager->GetInventoryContainer(InventoryType.EquippedItems); if (equippedContainer == null) - return false; + return; if (_targetSlots.Any(slot => equippedContainer->GetInventorySlot(slot)->ItemId == _itemId)) { logger.LogInformation("Already equipped {Item}, skipping step", _item.Name?.ToString()); - return false; + return; } foreach (InventoryType sourceInventoryType in SourceInventoryTypes) @@ -134,11 +134,9 @@ internal static class EquipItem int result = inventoryManager->MoveItemSlot(sourceInventoryType, sourceSlot, InventoryType.EquippedItems, targetSlot, 1); logger.LogInformation("MoveItemSlot result: {Result}", result); - return result == 0; + return; } } - - return false; } private static List? GetEquipSlot(Item item) diff --git a/Questionable/Data/AetherCurrentData.cs b/Questionable/Data/AetherCurrentData.cs index 420b98ec..f83b99c0 100644 --- a/Questionable/Data/AetherCurrentData.cs +++ b/Questionable/Data/AetherCurrentData.cs @@ -2,7 +2,6 @@ using System.Linq; using Dalamud.Plugin.Services; using Lumina.Excel.GeneratedSheets2; -using Microsoft.Extensions.Logging; namespace Questionable.Data; @@ -10,7 +9,7 @@ internal sealed class AetherCurrentData { private readonly ImmutableDictionary> _overworldCurrents; - public AetherCurrentData(IDataManager dataManager, ILogger logger) + public AetherCurrentData(IDataManager dataManager) { _overworldCurrents = dataManager.GetExcelSheet()! .Where(x => x.RowId > 0)