qstbak/Questionable/Questionable.Controller.NavigationOverrides/BlacklistedArea.cs
2025-10-09 07:47:19 +10:00

16 lines
534 B
C#

using System.Numerics;
namespace Questionable.Controller.NavigationOverrides;
internal sealed record BlacklistedArea(ushort TerritoryId, Vector3 Center, float MinDistance, float MaxDistance, bool RecalculateNavmesh = false) : IBlacklistedLocation
{
public AlternateLocation? AdjustPoint(Vector3 point)
{
float num = (point - Center).Length();
if (num < MinDistance || num > MaxDistance)
{
return null;
}
return new AlternateLocation(Center + Vector3.Normalize(point - Center) * MaxDistance, RecalculateNavmesh);
}
}