Rename FindUnits -> FindActorsInBox.

This commit is contained in:
Paul Chote
2013-07-20 14:03:35 +12:00
parent 37c02fea79
commit 27f04c1b78
9 changed files with 13 additions and 13 deletions

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Activities
{
if (!limitedAmmo.GiveAmmo()) return NextActivity;
var hostBuilding = self.World.FindUnits(self.CenterPosition, self.CenterPosition)
var hostBuilding = self.World.FindActorsInBox(self.CenterPosition, self.CenterPosition)
.FirstOrDefault(a => a.HasTrait<RenderBuilding>());
if (hostBuilding != null)

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Mods.RA.Air
if (self.Trait<IMove>().Altitude != 0)
return null; // not on the ground.
return self.World.FindUnits(self.CenterPosition, self.CenterPosition)
return self.World.FindActorsInBox(self.CenterPosition, self.CenterPosition)
.FirstOrDefault( a => a.HasTrait<Reservable>() );
}

View File

@@ -118,7 +118,7 @@ namespace OpenRA.Mods.RA
case DamageModel.PerCell:
{
foreach (var t in world.FindTilesInCircle(targetTile, warhead.Size[0]))
foreach (var unit in world.FindUnits(t, t))
foreach (var unit in world.FindActorsInBox(t, t))
unit.InflictDamage(args.firedBy,
(int)(warhead.Damage * warhead.EffectivenessAgainst(unit)), warhead);
} break;

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA.Missions
public static IEnumerable<Actor> FindAliveCombatantActorsInBox(this World world, CPos a, CPos b)
{
return world.FindUnits(a, b)
return world.FindActorsInBox(a, b)
.Where(u => u.IsInWorld && u != world.WorldActor && !u.IsDead() && !u.Owner.NonCombatant);
}

View File

@@ -129,7 +129,7 @@ namespace OpenRA.Mods.RA.Missions
if (baseTransferredTick == -1)
{
var actorsInBase = world.FindUnits(alliedBaseTopLeft.Location, alliedBaseBottomRight.Location).Where(a => a != a.Owner.PlayerActor);
var actorsInBase = world.FindActorsInBox(alliedBaseTopLeft.Location, alliedBaseBottomRight.Location).Where(a => a != a.Owner.PlayerActor);
if (actorsInBase.Any(a => a.Owner == greece))
{
SetupAlliedBase(actorsInBase);

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Mods.RA.Render
if (!hasTicked)
{
var vec = new CVec(1, 1);
var adjWalls = self.World.FindUnits(self.Location - vec, self.Location + vec)
var adjWalls = self.World.FindActorsInBox(self.Location - vec, self.Location + vec)
.Where(a => a.Info == self.Info && a != self);
foreach (var w in adjWalls)