ClonesProductionUnits:
string[] CloneableTypes checks Cloneable.Types Cloneable: string[] Types checked by ClonesProductionUnits.CloneableTypes Added INotifyOtherProduction for notifying self when another actor produces a unit.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
using OpenRA.Primitives;
|
||||
@@ -96,6 +97,12 @@ namespace OpenRA.Mods.RA
|
||||
if (!self.IsDead())
|
||||
foreach (var t in self.TraitsImplementing<INotifyProduction>())
|
||||
t.UnitProduced(self, newUnit, exit);
|
||||
|
||||
var notifyOthers = self.World.ActorsWithTrait<INotifyOtherProduction>()
|
||||
.Where(a => a.Actor.Owner == self.Owner);
|
||||
|
||||
foreach (var notify in notifyOthers)
|
||||
notify.Trait.UnitProducedByOther(notify.Actor, self, newUnit);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user