fix: Cleans up the GetXDistance methods. (#2279)

This commit is contained in:
Kamron Batman 2025-11-28 11:01:20 -08:00 committed by GitHub
parent f2ce860c18
commit 06443ba0ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 9 deletions

View file

@ -50,11 +50,7 @@ public partial class Map
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ClientDistanceEnumerable GetClientsInBoundsByDistance(Rectangle2D bounds) =>
GetClientsInBoundsByDistance(bounds, new Point2D(bounds.X + bounds.Width / 2, bounds.Y + bounds.Height / 2));
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ClientDistanceEnumerable GetClientsInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive) =>
public ClientDistanceEnumerable GetClientsInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive = false) =>
GetClientsInBoundsByDistance(bounds, new Point2D(bounds.X + bounds.Width / 2, bounds.Y + bounds.Height / 2), makeBoundsInclusive);
[MethodImpl(MethodImplOptions.AggressiveInlining)]

View file

@ -69,8 +69,8 @@ public partial class Map
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ItemDistanceEnumerable<Item> GetItemsInBoundsByDistance(Rectangle2D bounds) =>
GetItemsInBoundsByDistance<Item>(bounds);
public ItemDistanceEnumerable<Item> GetItemsInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive = false) =>
GetItemsInBoundsByDistance<Item>(bounds, makeBoundsInclusive);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ItemDistanceEnumerable<T> GetItemsInBoundsByDistance<T>(Rectangle2D bounds, bool makeBoundsInclusive = false)

View file

@ -69,8 +69,8 @@ public partial class Map
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public MobileDistanceEnumerable<Mobile> GetMobilesInBoundsByDistance(Rectangle2D bounds) =>
GetMobilesInBoundsByDistance<Mobile>(bounds);
public MobileDistanceEnumerable<Mobile> GetMobilesInBoundsByDistance(Rectangle2D bounds, bool makeBoundsInclusive = false) =>
GetMobilesInBoundsByDistance<Mobile>(bounds, makeBoundsInclusive);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public MobileDistanceEnumerable<T> GetMobilesInBoundsByDistance<T>(Rectangle2D bounds, bool makeBoundsInclusive = false) where T : Mobile =>