New types for cell and pixel coordinate position/vectors.

This commit is contained in:
James Dunne
2012-06-20 23:22:27 -05:00
parent 0b98a8ce5e
commit 9c49143534
162 changed files with 1291 additions and 865 deletions

View File

@@ -140,7 +140,8 @@ namespace OpenRA.Mods.RA.Widgets
{
var at = a.TraitOrDefault<AutoTarget>();
if (at != null) at.predictedStance = nextStance;
return new Order("SetUnitStance", a, false) { TargetLocation = new int2((int)nextStance, 0) };
// NOTE(jsd): Abuse of the type system here with `CPos`
return new Order("SetUnitStance", a, false) { TargetLocation = new CPos((int)nextStance, 0) };
});
Game.Debug( "Unit stance set to: {0}".F(nextStance) );
@@ -180,7 +181,7 @@ namespace OpenRA.Mods.RA.Widgets
if (eventNotifier.lastAttackTime < 0)
return true;
Game.viewport.Center(eventNotifier.lastAttackLocation);
Game.viewport.Center(eventNotifier.lastAttackLocation.ToFloat2());
return true;
}
}