Skip to content

Commit a84030a

Browse files
committed
Update
1 parent 6c311da commit a84030a

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

ECommons/ECommons.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<Authors>NightmareXIV</Authors>
5-
<BaseVersion>3.1.0.14</BaseVersion>
5+
<BaseVersion>3.1.0.15</BaseVersion>
66
<PackageKind></PackageKind>
77
<VersionSuffix Condition="'$(PackageKind)' != ''">-$(PackageKind)</VersionSuffix>
88
<Version>$(BaseVersion)$(VersionSuffix)</Version>

ECommons/MathHelpers/MathHelper.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
using ECommons.DalamudServices;
1+
using Dalamud.Game.ClientState.Objects.Types;
2+
using ECommons.DalamudServices;
23
using ECommons.Logging;
4+
using ECommons.ObjectLifeTracker;
35
using System;
46
using System.Collections.Generic;
57
using System.Linq;
@@ -418,4 +420,16 @@ public static bool InRange(this sbyte f, sbyte inclusiveStart, sbyte end, bool i
418420
{
419421
return f >= inclusiveStart && (includeEnd ? f <= end : f < end);
420422
}
423+
424+
425+
public static List<T> EnumerateObjectsClockwise<T>(IEnumerable<T> objects, Func<T, Vector2> getPosition, Vector2 centerPosition, Vector2 startingPosition)
426+
{
427+
var orderedList = objects.OrderBy(x =>
428+
{
429+
var relAngle = MathHelper.GetRelativeAngle(centerPosition, startingPosition);
430+
var a = (MathHelper.GetRelativeAngle(centerPosition, getPosition(x)) - relAngle + 360) % 360;
431+
return a;
432+
}).ToList();
433+
return orderedList;
434+
}
421435
}

0 commit comments

Comments
 (0)