Code cleanup
authorLiza Carvelli <liza@carvel.li>
Sun, 14 Jul 2024 14:17:08 +0000 (16:17 +0200)
committerLiza Carvelli <liza@carvel.li>
Sun, 14 Jul 2024 14:17:08 +0000 (16:17 +0200)
Questionable/Controller/CombatModules/RotationSolverRebornModule.cs
Questionable/Controller/Steps/Interactions/AethernetShard.cs
Questionable/Controller/Steps/Interactions/EquipItem.cs
Questionable/Data/AetherCurrentData.cs

index 23e94b3603ec3a1db7b94be9d8a456730f43bacc..d1a2bb92563639d85e109d31366970638de9d80a 100644 (file)
@@ -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,
index 5177c078eafc13b37ac4e55bf9b0e4917ea317b8..ec3969c9083dc256f8d001ce1a527d9f9821979e 100644 (file)
@@ -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;
index 65147b684eb0ed2c2f97e8f5e78adc58be1d6a99..6a6157a8388f9912935aa18eed3d2039c7138a07 100644 (file)
@@ -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<ushort>? GetEquipSlot(Item item)
index 420b98ec865066f0f679dff994c542636b9e8330..f83b99c0f911fcce6164c614c30da5a3c0f8b427 100644 (file)
@@ -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<ushort, ImmutableList<uint>> _overworldCurrents;
 
-    public AetherCurrentData(IDataManager dataManager, ILogger<AetherCurrentData> logger)
+    public AetherCurrentData(IDataManager dataManager)
     {
         _overworldCurrents = dataManager.GetExcelSheet<AetherCurrentCompFlgSet>()!
             .Where(x => x.RowId > 0)