Sync harvester contents. Add ISync to ProductionQueue.
This commit is contained in:
@@ -44,6 +44,12 @@ namespace OpenRA.Mods.RA
|
||||
[Sync]
|
||||
public int2 LastHarvestedCell = int2.Zero;
|
||||
|
||||
[Sync]
|
||||
public int ContentValue { get { return contents.Sum(c => c.Key.ValuePerUnit*c.Value); } }
|
||||
|
||||
[Sync]
|
||||
int currentUnloadTicks;
|
||||
|
||||
readonly HarvesterInfo Info;
|
||||
public Harvester(Actor self, HarvesterInfo info)
|
||||
{
|
||||
@@ -82,9 +88,7 @@ namespace OpenRA.Mods.RA
|
||||
else contents[type.info]++;
|
||||
}
|
||||
|
||||
// TODO: N-tick harvester unload.
|
||||
// Returns true when unloading is complete
|
||||
int currentUnloadTicks;
|
||||
public bool TickUnload(Actor self, Actor proc)
|
||||
{
|
||||
if (!proc.IsInWorld)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA
|
||||
public virtual object Create(ActorInitializer init) { return new ProductionQueue(init.self, init.self.Owner.PlayerActor, this); }
|
||||
}
|
||||
|
||||
public class ProductionQueue : IResolveOrder, ITick, ITechTreeElement, INotifyCapture
|
||||
public class ProductionQueue : IResolveOrder, ITick, ITechTreeElement, INotifyCapture, ISync
|
||||
{
|
||||
public readonly Actor self;
|
||||
public ProductionQueueInfo Info;
|
||||
@@ -41,7 +41,6 @@ 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]
|
||||
|
||||
Reference in New Issue
Block a user