rename TargetableSquares -> TargetableCells
This commit is contained in:
@@ -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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user