diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index cd2dd81757..44ffbfeac5 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -129,7 +129,10 @@ namespace OpenRA.Traits public interface IResolveOrder { void ResolveOrder(Actor self, Order order); } public interface IValidateOrder { bool OrderValidation(OrderManager orderManager, World world, int clientId, Order order); } public interface IOrderVoice { string VoicePhraseForOrder(Actor self, Order order); } + + [RequireExplicitImplementation] public interface INotifyCreated { void Created(Actor self); } + public interface INotifyAddedToWorld { void AddedToWorld(Actor self); } public interface INotifyRemovedFromWorld { void RemovedFromWorld(Actor self); } public interface INotifyActorDisposing { void Disposing(Actor self); } diff --git a/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs b/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs index 971776c52f..8b3dbd88fc 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs @@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits PaletteName = info.IsPlayerPalette ? info.Palette + self.Owner.InternalName : info.Palette; } - public void Created(Actor self) + void INotifyCreated.Created(Actor self) { self.World.Add(new RallyPointIndicator(self, this, self.Info.TraitInfos().ToArray())); } diff --git a/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeploy.cs b/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeploy.cs index f8a2c3752c..d42fc89911 100644 --- a/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeploy.cs +++ b/OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeploy.cs @@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Traits deployState = init.Get(); } - public void Created(Actor self) + void INotifyCreated.Created(Actor self) { conditionManager = self.TraitOrDefault(); notify = self.TraitsImplementing().ToArray(); diff --git a/OpenRA.Mods.Common/Traits/Guard.cs b/OpenRA.Mods.Common/Traits/Guard.cs index 01ffb25d1e..98cfff28c9 100644 --- a/OpenRA.Mods.Common/Traits/Guard.cs +++ b/OpenRA.Mods.Common/Traits/Guard.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits this.info = info; } - public void Created(Actor self) + void INotifyCreated.Created(Actor self) { move = self.Trait(); } diff --git a/OpenRA.Mods.Common/Traits/Husk.cs b/OpenRA.Mods.Common/Traits/Husk.cs index 174ff9e7f4..2d70ae6554 100644 --- a/OpenRA.Mods.Common/Traits/Husk.cs +++ b/OpenRA.Mods.Common/Traits/Husk.cs @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits finalPosition = init.World.Map.CenterOfCell(TopLeft); } - public void Created(Actor self) + void INotifyCreated.Created(Actor self) { var distance = (finalPosition - CenterPosition).Length; if (dragSpeed > 0 && distance > 0) diff --git a/OpenRA.Mods.Common/Traits/Pluggable.cs b/OpenRA.Mods.Common/Traits/Pluggable.cs index b0bfd0e639..277fabe23e 100644 --- a/OpenRA.Mods.Common/Traits/Pluggable.cs +++ b/OpenRA.Mods.Common/Traits/Pluggable.cs @@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits } } - public void Created(Actor self) + void INotifyCreated.Created(Actor self) { conditionManager = self.TraitOrDefault(); diff --git a/OpenRA.Mods.Common/Traits/ProducibleWithLevel.cs b/OpenRA.Mods.Common/Traits/ProducibleWithLevel.cs index 7533ba7750..dd2239984c 100644 --- a/OpenRA.Mods.Common/Traits/ProducibleWithLevel.cs +++ b/OpenRA.Mods.Common/Traits/ProducibleWithLevel.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits this.info = info; } - public void Created(Actor self) + void INotifyCreated.Created(Actor self) { if (!self.Owner.PlayerActor.Trait().HasPrerequisites(info.Prerequisites)) return; diff --git a/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs b/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs index 4130a3420e..be0720cbe3 100644 --- a/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/ProductionBar.cs @@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits.Render throw new InvalidOperationException("No queues available for production type '{0}'".F(type)); } - public void Created(Actor self) + void INotifyCreated.Created(Actor self) { FindQueue(); }