Add trait interfaces for added/removed from world.

This commit is contained in:
Paul Chote
2013-08-04 18:22:57 +12:00
parent c980d97027
commit c7350b704e
2 changed files with 8 additions and 1 deletions

View File

@@ -159,6 +159,9 @@ namespace OpenRA
a.IsInWorld = true;
actors.Add(a);
ActorAdded(a);
foreach (var t in a.TraitsImplementing<INotifyAddedToWorld>())
t.AddedToWorld(a);
}
public void Remove(Actor a)
@@ -166,7 +169,9 @@ namespace OpenRA
a.IsInWorld = false;
actors.Remove(a);
ActorRemoved(a);
foreach (var t in a.TraitsImplementing<INotifyRemovedFromWorld>())
t.RemovedFromWorld(a);
}
public void Add(IEffect b) { effects.Add(b); }