Change ITargetable TargetableCells -> TargetablePositions.

This commit is contained in:
Paul Chote
2013-07-10 19:08:53 +12:00
parent 7b3c322b13
commit 9b9952dcdf
4 changed files with 6 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Traits
if (targetable == null) if (targetable == null)
return new []{actor.CenterPosition}; return new []{actor.CenterPosition};
return targetable.TargetableCells(actor).Select(c => c.CenterPosition); return targetable.TargetablePositions(actor);
} }
} }

View File

@@ -201,7 +201,7 @@ namespace OpenRA.Traits
public interface ITargetable public interface ITargetable
{ {
string[] TargetTypes { get; } string[] TargetTypes { get; }
IEnumerable<CPos> TargetableCells(Actor self); IEnumerable<WPos> TargetablePositions(Actor self);
bool TargetableBy(Actor self, Actor byActor); bool TargetableBy(Actor self, Actor byActor);
} }

View File

@@ -31,9 +31,9 @@ namespace OpenRA.Mods.RA
public string[] TargetTypes { get { return info.TargetTypes; } } public string[] TargetTypes { get { return info.TargetTypes; } }
public bool TargetableBy(Actor self, Actor byActor) { return true; } public bool TargetableBy(Actor self, Actor byActor) { return true; }
public IEnumerable<CPos> TargetableCells( Actor self ) public IEnumerable<WPos> TargetablePositions(Actor self)
{ {
return self.Trait<Building>().OccupiedCells().Select(c => c.First); return self.Trait<Building>().OccupiedCells().Select(c => c.First.CenterPosition);
} }
} }
} }

View File

@@ -52,9 +52,9 @@ namespace OpenRA.Mods.RA
public virtual string[] TargetTypes { get { return info.TargetTypes; } } public virtual string[] TargetTypes { get { return info.TargetTypes; } }
public virtual IEnumerable<CPos> TargetableCells( Actor self ) public virtual IEnumerable<WPos> TargetablePositions(Actor self)
{ {
yield return self.CenterPosition.ToCPos(); yield return self.CenterPosition;
} }
} }
} }