Code cleanup

This commit is contained in:
Liza 2024-08-05 17:19:17 +02:00
parent 139250c4a4
commit ccd407c697
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 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);

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">
<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>

View File

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

View 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,

View 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;

View 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;