rename TargetableSquares -> TargetableCells

This commit is contained in:
Bob
2010-11-03 22:30:17 +13:00
committed by Chris Forbes
parent 39b09780f6
commit ecf41722c3
4 changed files with 4 additions and 4 deletions

View File

@@ -241,6 +241,6 @@ namespace OpenRA.Traits
public interface ITargetable public interface ITargetable
{ {
string[] TargetTypes { get; } string[] TargetTypes { get; }
IEnumerable<int2> TargetableSquares( Actor self ); IEnumerable<int2> TargetableCells( Actor self );
} }
} }

View File

@@ -223,7 +223,7 @@ namespace OpenRA.Mods.RA
public static bool IsInRange( float2 attackOrigin, float range, Actor target ) public static bool IsInRange( float2 attackOrigin, float range, Actor target )
{ {
var rsq = range * range * Game.CellSize * Game.CellSize; var rsq = range * range * Game.CellSize * Game.CellSize;
foreach( var cell in target.Trait<ITargetable>().TargetableSquares( target ) ) foreach( var cell in target.Trait<ITargetable>().TargetableCells( target ) )
if( ( attackOrigin - cell * Game.CellSize ).LengthSquared < rsq ) if( ( attackOrigin - cell * Game.CellSize ).LengthSquared < rsq )
return true; return true;
return false; return false;

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA
public string[] TargetTypes { get { return info.TargetTypes; } } public string[] TargetTypes { get { return info.TargetTypes; } }
public IEnumerable<int2> TargetableSquares( Actor self ) public IEnumerable<int2> TargetableCells( Actor self )
{ {
return self.Trait<Building>().OccupiedCells(); return self.Trait<Building>().OccupiedCells();
} }

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA
public virtual string[] TargetTypes { get { return info.TargetTypes; } } public virtual string[] TargetTypes { get { return info.TargetTypes; } }
public virtual IEnumerable<int2> TargetableSquares( Actor self ) public virtual IEnumerable<int2> TargetableCells( Actor self )
{ {
yield return Util.CellContaining( self.CenterLocation ); yield return Util.CellContaining( self.CenterLocation );
} }