Remove obsolete NearestCellTo helper.
This commit is contained in:
@@ -207,26 +207,6 @@ namespace OpenRA.Traits
|
||||
Pair<CPos, SubCell>[] OccupiedCells();
|
||||
}
|
||||
|
||||
public static class IOccupySpaceExts
|
||||
{
|
||||
public static CPos NearestCellTo(this IOccupySpace ios, CPos other)
|
||||
{
|
||||
var nearest = ios.TopLeft;
|
||||
var nearestDistance = int.MaxValue;
|
||||
foreach (var cell in ios.OccupiedCells())
|
||||
{
|
||||
var dist = (other - cell.First).LengthSquared;
|
||||
if (dist < nearestDistance)
|
||||
{
|
||||
nearest = cell.First;
|
||||
nearestDistance = dist;
|
||||
}
|
||||
}
|
||||
|
||||
return nearest;
|
||||
}
|
||||
}
|
||||
|
||||
public enum SubCell { Invalid = int.MinValue, Any = int.MinValue / 2, FullCell = 0, First = 1 }
|
||||
public interface IActorMap
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user