Make INotifyInfiltrated require explicit implementation

This commit is contained in:
reaperrr
2016-10-20 20:52:53 +02:00
parent 0f02a6ba7c
commit d9ecba7b60
7 changed files with 10 additions and 8 deletions

View File

@@ -302,7 +302,7 @@ namespace OpenRA.Mods.Common.Scripting
OnCapturedInternal(self); OnCapturedInternal(self);
} }
public void Infiltrated(Actor self, Actor infiltrator) void INotifyInfiltrated.Infiltrated(Actor self, Actor infiltrator)
{ {
if (world.Disposing) if (world.Disposing)
return; return;

View File

@@ -82,11 +82,13 @@ namespace OpenRA.Mods.Common.Traits
public interface INotifyDocking { void Docked(Actor self, Actor harvester); void Undocked(Actor self, Actor harvester); } public interface INotifyDocking { void Docked(Actor self, Actor harvester); void Undocked(Actor self, Actor harvester); }
public interface INotifyParachuteLanded { void OnLanded(Actor ignore); } public interface INotifyParachuteLanded { void OnLanded(Actor ignore); }
public interface INotifyCapture { void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner); } public interface INotifyCapture { void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner); }
public interface INotifyInfiltrated { void Infiltrated(Actor self, Actor infiltrator); }
public interface INotifyDiscovered { void OnDiscovered(Actor self, Player discoverer, bool playNotification); } public interface INotifyDiscovered { void OnDiscovered(Actor self, Player discoverer, bool playNotification); }
public interface IRenderActorPreviewInfo : ITraitInfo { IEnumerable<IActorPreview> RenderPreview(ActorPreviewInitializer init); } public interface IRenderActorPreviewInfo : ITraitInfo { IEnumerable<IActorPreview> RenderPreview(ActorPreviewInitializer init); }
public interface ICruiseAltitudeInfo : ITraitInfo { WDist GetCruiseAltitude(); } public interface ICruiseAltitudeInfo : ITraitInfo { WDist GetCruiseAltitude(); }
[RequireExplicitImplementation]
public interface INotifyInfiltrated { void Infiltrated(Actor self, Actor infiltrator); }
[RequireExplicitImplementation] [RequireExplicitImplementation]
public interface INotifyBlockingMove { void OnNotifyBlockingMove(Actor self, Actor blocking); } public interface INotifyBlockingMove { void OnNotifyBlockingMove(Actor self, Actor blocking); }

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA.Traits
public InfiltrateForCash(InfiltrateForCashInfo info) { this.info = info; } public InfiltrateForCash(InfiltrateForCashInfo info) { this.info = info; }
public void Infiltrated(Actor self, Actor infiltrator) void INotifyInfiltrated.Infiltrated(Actor self, Actor infiltrator)
{ {
var targetResources = self.Owner.PlayerActor.Trait<PlayerResources>(); var targetResources = self.Owner.PlayerActor.Trait<PlayerResources>();
var spyResources = infiltrator.Owner.PlayerActor.Trait<PlayerResources>(); var spyResources = infiltrator.Owner.PlayerActor.Trait<PlayerResources>();

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.RA.Traits
public InfiltrateForDecoration(Actor self, InfiltrateForDecorationInfo info) public InfiltrateForDecoration(Actor self, InfiltrateForDecorationInfo info)
: base(self, info) { } : base(self, info) { }
public void Infiltrated(Actor self, Actor infiltrator) void INotifyInfiltrated.Infiltrated(Actor self, Actor infiltrator)
{ {
infiltrators.Add(infiltrator.Owner); infiltrators.Add(infiltrator.Owner);
} }

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Traits
class InfiltrateForExploration : INotifyInfiltrated class InfiltrateForExploration : INotifyInfiltrated
{ {
public void Infiltrated(Actor self, Actor infiltrator) void INotifyInfiltrated.Infiltrated(Actor self, Actor infiltrator)
{ {
infiltrator.Owner.Shroud.Explore(self.Owner.Shroud); infiltrator.Owner.Shroud.Explore(self.Owner.Shroud);
if (!self.Owner.HasFogVisibility) if (!self.Owner.HasFogVisibility)

View File

@@ -32,12 +32,12 @@ namespace OpenRA.Mods.RA.Traits
playerPower = self.Owner.PlayerActor.Trait<PowerManager>(); playerPower = self.Owner.PlayerActor.Trait<PowerManager>();
} }
public void Infiltrated(Actor self, Actor infiltrator) void INotifyInfiltrated.Infiltrated(Actor self, Actor infiltrator)
{ {
playerPower.TriggerPowerOutage(info.Duration); playerPower.TriggerPowerOutage(info.Duration);
} }
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner) void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
{ {
playerPower = self.Owner.PlayerActor.Trait<PowerManager>(); playerPower = self.Owner.PlayerActor.Trait<PowerManager>();
} }

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Traits
this.info = info; this.info = info;
} }
public void Infiltrated(Actor self, Actor infiltrator) void INotifyInfiltrated.Infiltrated(Actor self, Actor infiltrator)
{ {
infiltrator.World.AddFrameEndTask(w => w.CreateActor(info.Proxy, new TypeDictionary infiltrator.World.AddFrameEndTask(w => w.CreateActor(info.Proxy, new TypeDictionary
{ {