All delegate events are refactored to use the Event<TSender> and Event<TSender, TArgument> for performance issues regarding delegate events creating garbage, also this gives us better control on event invocation since C# Delegates did also create unnecessary garbage during Delegate.DynamicInvoke
25 lines
994 B
C#
25 lines
994 B
C#
namespace Syntriax.Engine.Core;
|
|
|
|
/// <summary>
|
|
/// Indicates the object is an <see cref="IAssignable"/> with an assignable <see cref="IBehaviourController"/> field.
|
|
/// </summary>
|
|
public interface IHasBehaviourController : IAssignable
|
|
{
|
|
/// <summary>
|
|
/// Event triggered when the <see cref="IBehaviourController"/> value has has been assigned a new value.
|
|
/// </summary>
|
|
Event<IHasBehaviourController> OnBehaviourControllerAssigned { get; }
|
|
|
|
/// <inheritdoc cref="IBehaviourController" />
|
|
IBehaviourController BehaviourController { get; }
|
|
|
|
/// <summary>
|
|
/// Assign a value to the <see cref="IBehaviourController"/> field of this object.
|
|
/// </summary>
|
|
/// <param name="behaviourController">New <see cref="IBehaviourController"/> to assign.</param>
|
|
/// <returns>
|
|
/// <see cref="true"/>, if the value given assigned successfully assigned, <see cref="false"/> if not.
|
|
/// </returns>
|
|
bool Assign(IBehaviourController behaviourController);
|
|
}
|