Make INotifyInfiltrated require explicit implementation
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
@@ -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); }
|
||||||
|
|
||||||
|
|||||||
@@ -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>();
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
@@ -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>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user