Code cleanup

sb-p2
Liza 2024-08-05 17:19:17 +02:00
parent 139250c4a4
commit bb12299378
Signed by: liza
GPG Key ID: 7199F8D727D55F67
6 changed files with 10 additions and 10 deletions

View File

@ -2,23 +2,23 @@
using System.Numerics; using System.Numerics;
using Questionable.Model.Gathering; using Questionable.Model.Gathering;
namespace GatheringPathRenderer; namespace Questionable.Model;
public static class GatheringMath 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) public static (Vector3, int, float) CalculateLandingLocation(GatheringLocation location)
{ {
int degrees; int degrees;
if (location.IsCone()) if (location.IsCone())
degrees = RNG.Next( degrees = Rng.Next(
location.MinimumAngle.GetValueOrDefault(), location.MinimumAngle.GetValueOrDefault(),
location.MaximumAngle.GetValueOrDefault()); location.MaximumAngle.GetValueOrDefault());
else 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.CalculateMinimumDistance() * 100),
(int)((location.CalculateMaximumDistance() - location.CalculateMinimumDistance()) * 100)) / 100f; (int)((location.CalculateMaximumDistance() - location.CalculateMinimumDistance()) * 100)) / 100f;
return (CalculateLandingLocation(location.Position, degrees, range), degrees, range); return (CalculateLandingLocation(location.Position, degrees, range), degrees, range);

View 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"> <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/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/=aporia/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=arcadion/@EntryIndexedValue">True</s:Boolean> <s:Boolean x:Key="/Default/UserDictionary/Words/=arcadion/@EntryIndexedValue">True</s:Boolean>

View File

@ -182,7 +182,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
UpdateCurrentTask(); UpdateCurrentTask();
} }
private unsafe void UpdateCurrentQuest() private void UpdateCurrentQuest()
{ {
lock (_progressLock) lock (_progressLock)
{ {

View File

@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Dalamud.Game.Text; using Dalamud.Game.Text;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Component.GUI; using FFXIVClientStructs.FFXIV.Component.GUI;
@ -149,6 +150,7 @@ internal sealed class DoGatherCollectable(
public override string ToString() => public override string ToString() =>
$"DoGatherCollectable({SeIconChar.Collectible.ToIconString()} {_currentRequest.Collectability})"; $"DoGatherCollectable({SeIconChar.Collectible.ToIconString()} {_currentRequest.Collectability})";
[SuppressMessage("ReSharper", "NotAccessedPositionalProperty.Local")]
private sealed record NodeCondition( private sealed record NodeCondition(
uint CurrentCollectability, uint CurrentCollectability,
uint MaxCollectability, uint MaxCollectability,

View File

@ -4,11 +4,11 @@ using System.Linq;
using System.Numerics; using System.Numerics;
using Dalamud.Game.ClientState.Objects.Enums; using Dalamud.Game.ClientState.Objects.Enums;
using Dalamud.Plugin.Services; using Dalamud.Plugin.Services;
using GatheringPathRenderer;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Questionable.Controller.Steps.Shared; using Questionable.Controller.Steps.Shared;
using Questionable.Functions; using Questionable.Functions;
using Questionable.Model;
using Questionable.Model.Gathering; using Questionable.Model.Gathering;
namespace Questionable.Controller.Steps.Gathering; namespace Questionable.Controller.Steps.Gathering;

View File

@ -24,7 +24,6 @@ internal sealed class ActiveQuestComponent
private readonly MovementController _movementController; private readonly MovementController _movementController;
private readonly CombatController _combatController; private readonly CombatController _combatController;
private readonly GatheringController _gatheringController; private readonly GatheringController _gatheringController;
private readonly GameFunctions _gameFunctions;
private readonly QuestFunctions _questFunctions; private readonly QuestFunctions _questFunctions;
private readonly ICommandManager _commandManager; private readonly ICommandManager _commandManager;
private readonly IDalamudPluginInterface _pluginInterface; private readonly IDalamudPluginInterface _pluginInterface;
@ -37,7 +36,6 @@ internal sealed class ActiveQuestComponent
MovementController movementController, MovementController movementController,
CombatController combatController, CombatController combatController,
GatheringController gatheringController, GatheringController gatheringController,
GameFunctions gameFunctions,
QuestFunctions questFunctions, QuestFunctions questFunctions,
ICommandManager commandManager, ICommandManager commandManager,
IDalamudPluginInterface pluginInterface, IDalamudPluginInterface pluginInterface,
@ -49,7 +47,6 @@ internal sealed class ActiveQuestComponent
_movementController = movementController; _movementController = movementController;
_combatController = combatController; _combatController = combatController;
_gatheringController = gatheringController; _gatheringController = gatheringController;
_gameFunctions = gameFunctions;
_questFunctions = questFunctions; _questFunctions = questFunctions;
_commandManager = commandManager; _commandManager = commandManager;
_pluginInterface = pluginInterface; _pluginInterface = pluginInterface;