Rename FindUnits -> FindActorsInBox.
This commit is contained in:
@@ -73,7 +73,7 @@ namespace OpenRA.Graphics
|
||||
var bounds = Game.viewport.WorldBounds(world);
|
||||
var comparer = new RenderableComparer(this);
|
||||
|
||||
var actors = world.FindUnits(
|
||||
var actors = world.FindActorsInBox(
|
||||
bounds.TopLeftAsCPos(),
|
||||
bounds.BottomRightAsCPos());
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace OpenRA.Widgets
|
||||
static readonly Actor[] NoActors = {};
|
||||
IEnumerable<Actor> SelectActorsInBox(World world, PPos a, PPos b, Func<Actor, bool> cond)
|
||||
{
|
||||
return world.FindUnits(a.ToWPos(0), b.ToWPos(0))
|
||||
return world.FindActorsInBox(a.ToWPos(0), b.ToWPos(0))
|
||||
.Where(x => x.HasTrait<Selectable>() && x.Trait<Selectable>().Info.Selectable && !world.FogObscures(x) && cond(x))
|
||||
.GroupBy(x => x.GetSelectionPriority())
|
||||
.OrderByDescending(g => g.Key)
|
||||
|
||||
@@ -24,15 +24,15 @@ namespace OpenRA
|
||||
public static IEnumerable<Actor> FindUnitsAtMouse(this World world, int2 mouseLocation)
|
||||
{
|
||||
var loc = Game.viewport.ViewToWorldPx(mouseLocation).ToWPos(0);
|
||||
return FindUnits(world, loc, loc).Where(a => !world.FogObscures(a));
|
||||
return FindActorsInBox(world, loc, loc).Where(a => !world.FogObscures(a));
|
||||
}
|
||||
|
||||
public static IEnumerable<Actor> FindUnits(this World world, CPos tl, CPos br)
|
||||
public static IEnumerable<Actor> FindActorsInBox(this World world, CPos tl, CPos br)
|
||||
{
|
||||
return world.FindUnits(tl.TopLeft, br.BottomRight);
|
||||
return world.FindActorsInBox(tl.TopLeft, br.BottomRight);
|
||||
}
|
||||
|
||||
public static IEnumerable<Actor> FindUnits(this World world, WPos tl, WPos br)
|
||||
public static IEnumerable<Actor> FindActorsInBox(this World world, WPos tl, WPos br)
|
||||
{
|
||||
var a = PPos.FromWPos(tl);
|
||||
var b = PPos.FromWPos(br);
|
||||
@@ -59,7 +59,7 @@ namespace OpenRA
|
||||
// Target ranges are calculated in 2D, so ignore height differences
|
||||
var vec = new WVec(r, r, WRange.Zero);
|
||||
var rSq = r.Range*r.Range;
|
||||
return world.FindUnits(origin - vec, origin + vec).Where(a =>
|
||||
return world.FindActorsInBox(origin - vec, origin + vec).Where(a =>
|
||||
{
|
||||
var pos = a.CenterPosition;
|
||||
var dx = (long)(pos.X - origin.X);
|
||||
|
||||
Reference in New Issue
Block a user