/// <summary> /// Adds a behavior to a stunt. /// </summary> public static TStunt AddBehavior <TStunt>(this TStunt stunt, IStuntBehavior behavior) { if (stunt is IStunt target) { target.Behaviors.Add(behavior); } else { throw new ArgumentException(nameof(stunt)); } return(stunt); }
/// <summary> /// Inserts a behavior into the stunt behavior pipeline at the specified /// index. /// </summary> public static TStunt InsertBehavior <TStunt>(this TStunt stunt, int index, IStuntBehavior behavior) { if (stunt is IStunt target) { target.Behaviors.Insert(index, behavior); } else { throw new ArgumentException(nameof(stunt)); } return(stunt); }
/// <summary> /// Inserts a behavior into the stunt behavior pipeline at the specified /// index. /// </summary> public static IStunt InsertBehavior(this IStunt stunt, int index, IStuntBehavior behavior) { stunt.Behaviors.Insert(index, behavior); return(stunt); }
/// <summary> /// Adds a behavior to a stunt. /// </summary> public static IStunt AddBehavior(this IStunt stunt, IStuntBehavior behavior) { stunt.Behaviors.Add(behavior); return(stunt); }