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

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA
BaseAttackNotifierInfo info;
public int lastAttackTime = -1;
public float2 lastAttackLocation;
public CPos lastAttackLocation;
public BaseAttackNotifier(BaseAttackNotifierInfo info) { this.info = info; }
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.RA
if (self.World.FrameNumber - lastAttackTime > info.NotifyInterval * 25)
Sound.PlayToPlayer(self.Owner, info.Audio);
lastAttackLocation = self.CenterLocation / Game.CellSize;
lastAttackLocation = self.CenterLocation.ToCPos();
lastAttackTime = self.World.FrameNumber;
}
}

View File

@@ -44,18 +44,12 @@ namespace OpenRA.Mods.RA
// A list of things we are currently building
public List<ProductionItem> Queue = new List<ProductionItem>();
[Sync]
public int QueueLength { get { return Queue.Count; } }
[Sync]
public int CurrentRemainingCost { get { return QueueLength == 0 ? 0 : Queue[0].RemainingCost; } }
[Sync]
public int CurrentRemainingTime { get { return QueueLength == 0 ? 0 : Queue[0].RemainingTime; } }
[Sync]
public int CurrentSlowdown { get { return QueueLength == 0 ? 0 : Queue[0].slowdown; } }
[Sync]
public bool CurrentPaused { get { return QueueLength == 0 ? false : Queue[0].Paused; } }
[Sync]
public bool CurrentDone { get { return QueueLength == 0 ? false : Queue[0].Done; } }
[Sync] public int QueueLength { get { return Queue.Count; } }
[Sync] public int CurrentRemainingCost { get { return QueueLength == 0 ? 0 : Queue[0].RemainingCost; } }
[Sync] public int CurrentRemainingTime { get { return QueueLength == 0 ? 0 : Queue[0].RemainingTime; } }
[Sync] public int CurrentSlowdown { get { return QueueLength == 0 ? 0 : Queue[0].slowdown; } }
[Sync] public bool CurrentPaused { get { return QueueLength == 0 ? false : Queue[0].Paused; } }
[Sync] public bool CurrentDone { get { return QueueLength == 0 ? false : Queue[0].Done; } }
// A list of things we could possibly build, even if our race doesn't normally get it
public Dictionary<ActorInfo, ProductionState> Produceable;