Remove PPos overload of FindUnits.
This commit is contained in:
@@ -74,8 +74,8 @@ namespace OpenRA.Graphics
|
||||
var comparer = new RenderableComparer(this);
|
||||
|
||||
var actors = world.FindUnits(
|
||||
bounds.TopLeftAsCPos().ToPPos(),
|
||||
bounds.BottomRightAsCPos().ToPPos());
|
||||
bounds.TopLeftAsCPos(),
|
||||
bounds.BottomRightAsCPos());
|
||||
|
||||
var worldRenderables = actors.SelectMany(a => a.Render(this))
|
||||
.OrderBy(r => r, comparer);
|
||||
|
||||
@@ -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, b)
|
||||
return world.FindUnits(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)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA
|
||||
{
|
||||
public static IEnumerable<Actor> FindUnitsAtMouse(this World world, int2 mouseLocation)
|
||||
{
|
||||
var loc = Game.viewport.ViewToWorldPx(mouseLocation);
|
||||
var loc = Game.viewport.ViewToWorldPx(mouseLocation).ToWPos(0);
|
||||
return FindUnits(world, loc, loc).Where(a => !world.FogObscures(a));
|
||||
}
|
||||
|
||||
@@ -34,11 +34,8 @@ namespace OpenRA
|
||||
|
||||
public static IEnumerable<Actor> FindUnits(this World world, WPos tl, WPos br)
|
||||
{
|
||||
return world.FindUnits(PPos.FromWPos(tl), PPos.FromWPos(br));
|
||||
}
|
||||
|
||||
public static IEnumerable<Actor> FindUnits(this World world, PPos a, PPos b)
|
||||
{
|
||||
var a = PPos.FromWPos(tl);
|
||||
var b = PPos.FromWPos(br);
|
||||
var u = PPos.Min(a, b);
|
||||
var v = PPos.Max(a, b);
|
||||
return world.WorldActor.Trait<SpatialBins>().ActorsInBox(u,v);
|
||||
|
||||
Reference in New Issue
Block a user