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:
Taryn Hill
2014-07-09 20:38:06 -05:00
parent e24b9323c8
commit b4cecff74e
6 changed files with 86 additions and 0 deletions

View File

@@ -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);
});
}