Add INotify(Activity)StanceChanged interfaces.
This commit is contained in:
@@ -171,6 +171,20 @@ namespace OpenRA.Activities
|
||||
act = act.childActivity;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<T> ActivitiesImplementing<T>() where T : IActivityInterface
|
||||
{
|
||||
if (childActivity != null)
|
||||
foreach (var a in childActivity.ActivitiesImplementing<T>())
|
||||
yield return a;
|
||||
|
||||
if (this is T)
|
||||
yield return (T)(object)this;
|
||||
|
||||
if (NextActivity != null)
|
||||
foreach (var a in NextActivity.ActivitiesImplementing<T>())
|
||||
yield return a;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ActivityExts
|
||||
|
||||
@@ -350,6 +350,8 @@ namespace OpenRA.Traits
|
||||
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1302:InterfaceNamesMustBeginWithI", Justification = "Not a real interface, but more like a tag.")]
|
||||
public interface Requires<T> where T : class, ITraitInfoInterface { }
|
||||
|
||||
public interface IActivityInterface { }
|
||||
|
||||
[RequireExplicitImplementation]
|
||||
public interface INotifySelected { void Selected(Actor self); }
|
||||
[RequireExplicitImplementation]
|
||||
|
||||
Reference in New Issue
Block a user