From 0319b8cbdab44f27db49ee47d59cdf0c0807405a Mon Sep 17 00:00:00 2001 From: atlimit8 Date: Thu, 24 Jul 2014 19:41:01 -0500 Subject: [PATCH] INotifyCreated --- OpenRA.Game/Traits/TraitsInterfaces.cs | 1 + OpenRA.Game/World.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 563acaeece..088f7d515a 100644 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -63,6 +63,7 @@ namespace OpenRA.Traits public interface IValidateOrder { bool OrderValidation(OrderManager orderManager, World world, int clientId, Order order); } public interface IOrderVoice { string VoicePhraseForOrder(Actor self, Order order); } public interface INotify { void Play(Player p, string notification); } + public interface INotifyCreated { void Created(Actor self); } public interface INotifyAddedToWorld { void AddedToWorld(Actor self); } public interface INotifyRemovedFromWorld { void RemovedFromWorld(Actor self); } public interface INotifySold { void Selling(Actor self); void Sold(Actor self); } diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 50b04194e5..d58d68e474 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -188,6 +188,8 @@ namespace OpenRA public Actor CreateActor(bool addToWorld, string name, TypeDictionary initDict) { var a = new Actor(this, name, initDict); + foreach (var t in a.TraitsImplementing()) + t.Created(a); if (addToWorld) Add(a); return a;