Code cleanup v2.2
authorLiza Carvelli <liza@carvel.li>
Mon, 5 Aug 2024 15:19:17 +0000 (17:19 +0200)
committerLiza Carvelli <liza@carvel.li>
Mon, 5 Aug 2024 15:19:17 +0000 (17:19 +0200)
Questionable.Model/GatheringMath.cs
Questionable.sln.DotSettings
Questionable/Controller/QuestController.cs
Questionable/Controller/Steps/Gathering/DoGatherCollectable.cs
Questionable/Controller/Steps/Gathering/MoveToLandingLocation.cs
Questionable/Windows/QuestComponents/ActiveQuestComponent.cs

index 46105e1aa2190f3f186a887f568d6093970c23dd..86fca78545036588237b430d37350080e59bd967 100644 (file)
@@ -2,23 +2,23 @@
 using System.Numerics;
 using Questionable.Model.Gathering;
 
-namespace GatheringPathRenderer;
+namespace Questionable.Model;
 
 public static class GatheringMath
 {
-    private static readonly Random RNG = new Random();
+    private static readonly Random Rng = new Random();
 
     public static (Vector3, int, float) CalculateLandingLocation(GatheringLocation location)
     {
         int degrees;
         if (location.IsCone())
-            degrees = RNG.Next(
+            degrees = Rng.Next(
                 location.MinimumAngle.GetValueOrDefault(),
                 location.MaximumAngle.GetValueOrDefault());
         else
-            degrees = RNG.Next(0, 360);
+            degrees = Rng.Next(0, 360);
 
-        float range = RNG.Next(
+        float range = Rng.Next(
             (int)(location.CalculateMinimumDistance() * 100),
             (int)((location.CalculateMaximumDistance() - location.CalculateMinimumDistance()) * 100)) / 100f;
         return (CalculateLandingLocation(location.Position, degrees, range), degrees, range);
index a8a650e8a6cf3c6fc7311958754f1d5a4a45b543..3c6b4ec86e0020a1cd4e7832fc6490354778c533 100644 (file)
@@ -1,4 +1,5 @@
 <wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
+       <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=vendor_005CECommons/@EntryIndexedValue">ExplicitlyExcluded</s:String>
        <s:Boolean x:Key="/Default/Environment/AutoImport2/=CSHARP/BlackLists/=Newtonsoft_002E_002A/@EntryIndexedValue">True</s:Boolean>
        <s:Boolean x:Key="/Default/UserDictionary/Words/=aporia/@EntryIndexedValue">True</s:Boolean>
        <s:Boolean x:Key="/Default/UserDictionary/Words/=arcadion/@EntryIndexedValue">True</s:Boolean>
index 1b62bc6507e29f19a37f055b5e8921e6d1294b76..3cf9def6388195744261cb30f20c9c769627ac24 100644 (file)
@@ -182,7 +182,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
         UpdateCurrentTask();
     }
 
-    private unsafe void UpdateCurrentQuest()
+    private void UpdateCurrentQuest()
     {
         lock (_progressLock)
         {
index 45f4113d229ba971ec2e4d2a65e552a7500e1f7e..36447e997f60abd0f3ee93d04a5dc87861b3a44c 100644 (file)
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
 using Dalamud.Game.Text;
 using Dalamud.Plugin.Services;
 using FFXIVClientStructs.FFXIV.Component.GUI;
@@ -149,6 +150,7 @@ internal sealed class DoGatherCollectable(
     public override string ToString() =>
         $"DoGatherCollectable({SeIconChar.Collectible.ToIconString()} {_currentRequest.Collectability})";
 
+    [SuppressMessage("ReSharper", "NotAccessedPositionalProperty.Local")]
     private sealed record NodeCondition(
         uint CurrentCollectability,
         uint MaxCollectability,
index b565cfc1e18c179a00d82e73db22a4a2bff2b7da..ff27374ed2a96392884b1995abf3dce9cd7277cf 100644 (file)
@@ -4,11 +4,11 @@ using System.Linq;
 using System.Numerics;
 using Dalamud.Game.ClientState.Objects.Enums;
 using Dalamud.Plugin.Services;
-using GatheringPathRenderer;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Logging;
 using Questionable.Controller.Steps.Shared;
 using Questionable.Functions;
+using Questionable.Model;
 using Questionable.Model.Gathering;
 
 namespace Questionable.Controller.Steps.Gathering;
index 3c1a92ff2f3f5f8f5f0b919f7a8d733a71aa8524..e1ef508bdb185cf5dbe19294ced217ac5a59fee8 100644 (file)
@@ -24,7 +24,6 @@ internal sealed class ActiveQuestComponent
     private readonly MovementController _movementController;
     private readonly CombatController _combatController;
     private readonly GatheringController _gatheringController;
-    private readonly GameFunctions _gameFunctions;
     private readonly QuestFunctions _questFunctions;
     private readonly ICommandManager _commandManager;
     private readonly IDalamudPluginInterface _pluginInterface;
@@ -37,7 +36,6 @@ internal sealed class ActiveQuestComponent
         MovementController movementController,
         CombatController combatController,
         GatheringController gatheringController,
-        GameFunctions gameFunctions,
         QuestFunctions questFunctions,
         ICommandManager commandManager,
         IDalamudPluginInterface pluginInterface,
@@ -49,7 +47,6 @@ internal sealed class ActiveQuestComponent
         _movementController = movementController;
         _combatController = combatController;
         _gatheringController = gatheringController;
-        _gameFunctions = gameFunctions;
         _questFunctions = questFunctions;
         _commandManager = commandManager;
         _pluginInterface = pluginInterface;