feat: IBehaviourController.CollectionMethod added
This commit is contained in:
@@ -62,7 +62,8 @@ public interface IBehaviourController : IEntity, IHasUniverseObject
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of <see cref="IBehaviour"/>s to get.</typeparam>
|
||||
/// <param name="results">The list to store the <see cref="IBehaviour"/>s.</param>
|
||||
void GetBehaviours<T>(IList<T> results);
|
||||
/// <param name="collectionMethod">Whether to clear the <paramref name="results"/> before collection or append the results to the list.</param>
|
||||
void GetBehaviours<T>(IList<T> results, CollectionMethod collectionMethod = CollectionMethod.Clear);
|
||||
|
||||
/// <summary>
|
||||
/// Removes <see cref="IBehaviour"/>s of the specified type from the <see cref="IBehaviourController"/>.
|
||||
@@ -78,6 +79,8 @@ public interface IBehaviourController : IEntity, IHasUniverseObject
|
||||
/// <param name="behaviour">The <see cref="IBehaviour"/> to remove.</param>
|
||||
void RemoveBehaviour<T>(T behaviour) where T : class, IBehaviour;
|
||||
|
||||
enum CollectionMethod { Clear, Append };
|
||||
|
||||
readonly record struct BehaviourAddedArguments(IBehaviour BehaviourAdded);
|
||||
readonly record struct BehaviourRemovedArguments(IBehaviour BehaviourRemoved);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user