Remove obsolete NearestCellTo helper.

This commit is contained in:
Paul Chote
2017-12-17 12:32:19 +00:00
parent 30cafcbc25
commit e35e93557c

View File

@@ -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
{