Merge INotifyBeingResupplied into INotifyDockClient
This commit is contained in:
@@ -28,7 +28,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
readonly RepairableNear repairableNear;
|
||||
readonly Rearmable rearmable;
|
||||
readonly INotifyResupply[] notifyResupplies;
|
||||
readonly INotifyBeingResupplied[] notifyBeingResupplied;
|
||||
readonly INotifyDockHost[] notifyDockHosts;
|
||||
readonly INotifyDockClient[] notifyDockClients;
|
||||
readonly ICallForTransport[] transportCallers;
|
||||
readonly IMove move;
|
||||
readonly Aircraft aircraft;
|
||||
@@ -54,7 +55,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
repairableNear = self.TraitOrDefault<RepairableNear>();
|
||||
rearmable = self.TraitOrDefault<Rearmable>();
|
||||
notifyResupplies = host.TraitsImplementing<INotifyResupply>().ToArray();
|
||||
notifyBeingResupplied = self.TraitsImplementing<INotifyBeingResupplied>().ToArray();
|
||||
notifyDockHosts = host.TraitsImplementing<INotifyDockHost>().ToArray();
|
||||
notifyDockClients = self.TraitsImplementing<INotifyDockClient>().ToArray();
|
||||
transportCallers = self.TraitsImplementing<ICallForTransport>().ToArray();
|
||||
move = self.Trait<IMove>();
|
||||
aircraft = move as Aircraft;
|
||||
@@ -150,8 +152,11 @@ namespace OpenRA.Mods.Common.Activities
|
||||
foreach (var notifyResupply in notifyResupplies)
|
||||
notifyResupply.BeforeResupply(host.Actor, self, activeResupplyTypes);
|
||||
|
||||
foreach (var br in notifyBeingResupplied)
|
||||
br.StartingResupply(self, host.Actor);
|
||||
foreach (var nd in notifyDockClients)
|
||||
nd.Docked(self, host.Actor);
|
||||
|
||||
foreach (var nd in notifyDockHosts)
|
||||
nd.Docked(host.Actor, self);
|
||||
}
|
||||
|
||||
if (activeResupplyTypes.HasFlag(ResupplyType.Repair))
|
||||
@@ -241,8 +246,11 @@ namespace OpenRA.Mods.Common.Activities
|
||||
QueueChild(move.MoveToTarget(self, host));
|
||||
}
|
||||
|
||||
foreach (var br in notifyBeingResupplied)
|
||||
br.StoppingResupply(self, isHostInvalid ? null : host.Actor);
|
||||
foreach (var nd in notifyDockClients)
|
||||
nd.Undocked(self, host.Actor);
|
||||
|
||||
foreach (var nd in notifyDockHosts)
|
||||
nd.Undocked(host.Actor, self);
|
||||
}
|
||||
|
||||
void RepairTick(Actor self)
|
||||
|
||||
Reference in New Issue
Block a user