Add world coord overloads to IOccupySpace and IPositionable.

This commit is contained in:
Paul Chote
2013-07-21 12:04:00 +12:00
parent 3e9bc63d4e
commit 19165d259d
8 changed files with 37 additions and 3 deletions

View File

@@ -85,16 +85,20 @@ namespace OpenRA.Mods.RA
public CPos TopLeft { get { return Location; } }
public IEnumerable<Pair<CPos, SubCell>> OccupiedCells() { yield return Pair.New( Location, SubCell.FullCell); }
public WPos CenterPosition { get { return PxPosition.ToWPos(Altitude); } }
public PPos PxPosition { get; private set; }
public int Altitude { get { return 0; } set { } }
public void SetPxPosition(Actor self, PPos px)
{
SetPosition( self, px.ToCPos() );
SetPosition(self, px.ToCPos());
}
public void AdjustPxPosition(Actor self, PPos px) { SetPxPosition(self, px); }
public void SetPosition(Actor self, WPos pos) { SetPosition(self, pos.ToCPos()); }
public void SetVisualPosition(Actor self, WPos pos) { SetPosition(self, pos.ToCPos()); }
public bool CanEnterCell(CPos cell)
{
if (!self.World.Map.IsInMap(cell.X, cell.Y)) return false;