Refactor Mobile.TeleportTo -> IMove.SetPosition

This commit is contained in:
Paul Chote
2010-06-23 21:09:42 +12:00
parent 3e664779ef
commit 37cf30a097
8 changed files with 22 additions and 9 deletions

View File

@@ -66,9 +66,9 @@ namespace OpenRA.Traits
self.World.WorldActor.traits.Get<UnitInfluence>().Add(self, this);
}
public void TeleportTo(Actor self, int2 xy)
public void SetPosition(Actor self, int2 cell)
{
SetLocation( xy, xy );
SetLocation( cell, cell );
self.CenterLocation = Util.CenterOfCell(fromCell);
}

View File

@@ -101,6 +101,7 @@ namespace OpenRA.Traits
UnitMovementType GetMovementType();
bool CanEnterCell(int2 location);
IEnumerable<float2> GetCurrentPath(Actor self);
void SetPosition(Actor self, int2 cell);
}
public interface IOffsetCenterLocation { float2 CenterOffset { get; } }