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

@@ -167,6 +167,7 @@ namespace OpenRA.Mods.RA.Move
public int ROT { get { return Info.ROT; } }
public WPos CenterPosition { get { return PxPosition.ToWPos(Altitude); } }
[Sync] public PPos PxPosition { get; private set; }
[Sync] public CPos fromCell { get { return __fromCell; } }
[Sync] public CPos toCell { get { return __toCell; } }
@@ -231,6 +232,18 @@ namespace OpenRA.Mods.RA.Move
PxPosition = px;
}
public void SetPosition(Actor self, WPos pos)
{
// TODO: Handle altitude
SetPxPosition(self, PPos.FromWPos(pos));
}
public void SetVisualPosition(Actor self, WPos pos)
{
// TODO: Handle altitude
AdjustPxPosition(self, PPos.FromWPos(pos));
}
public IEnumerable<IOrderTargeter> Orders { get { yield return new MoveOrderTargeter(Info); } }
// Note: Returns a valid order even if the unit can't move to the target