Add INotifyDockHost and INotifyDockClient interfaces
Rename INotifyDocking to INotifyDockHost and extract INotifyDockClient from INotifyHarvesterAction
This commit is contained in:
@@ -30,9 +30,10 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
public override void OnStateDock(Actor self)
|
||||
{
|
||||
body.Docked = true;
|
||||
foreach (var trait in self.TraitsImplementing<INotifyHarvesterAction>())
|
||||
trait.Docked();
|
||||
foreach (var nd in Refinery.TraitsImplementing<INotifyDocking>())
|
||||
foreach (var nd in self.TraitsImplementing<INotifyDockClient>())
|
||||
nd.Docked(self, Refinery);
|
||||
|
||||
foreach (var nd in Refinery.TraitsImplementing<INotifyDockHost>())
|
||||
nd.Docked(Refinery, self);
|
||||
|
||||
if (spriteOverlay != null && !spriteOverlay.Visible)
|
||||
@@ -63,11 +64,11 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
body.Docked = false;
|
||||
spriteOverlay.Visible = false;
|
||||
|
||||
foreach (var trait in self.TraitsImplementing<INotifyHarvesterAction>())
|
||||
trait.Undocked();
|
||||
foreach (var nd in self.TraitsImplementing<INotifyDockClient>())
|
||||
nd.Undocked(self, Refinery);
|
||||
|
||||
if (Refinery.IsInWorld && !Refinery.IsDead)
|
||||
foreach (var nd in Refinery.TraitsImplementing<INotifyDocking>())
|
||||
foreach (var nd in Refinery.TraitsImplementing<INotifyDockHost>())
|
||||
nd.Undocked(Refinery, self);
|
||||
});
|
||||
}
|
||||
@@ -76,11 +77,11 @@ namespace OpenRA.Mods.Cnc.Activities
|
||||
dockingState = DockingState.Complete;
|
||||
body.Docked = false;
|
||||
|
||||
foreach (var trait in self.TraitsImplementing<INotifyHarvesterAction>())
|
||||
trait.Undocked();
|
||||
foreach (var nd in self.TraitsImplementing<INotifyDockClient>())
|
||||
nd.Undocked(self, Refinery);
|
||||
|
||||
if (Refinery.IsInWorld && !Refinery.IsDead)
|
||||
foreach (var nd in Refinery.TraitsImplementing<INotifyDocking>())
|
||||
foreach (var nd in Refinery.TraitsImplementing<INotifyDockHost>())
|
||||
nd.Undocked(Refinery, self);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user