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
20 lines
664 B
C#
20 lines
664 B
C#
namespace Syntriax.Engine.Core;
|
|
|
|
/// <summary>
|
|
/// Represents a behaviour that any object in the engine that might use to interact with itself or other objects.
|
|
/// </summary>
|
|
public interface IBehaviour : IEntity, IActive, IHasBehaviourController, IHasStateEnable
|
|
{
|
|
/// <summary>
|
|
/// Event triggered when the priority of the <see cref="IBehaviour"/> changes.
|
|
/// </summary>
|
|
Event<IBehaviour, PriorityChangedArguments> OnPriorityChanged { get; }
|
|
|
|
/// <summary>
|
|
/// The priority of the <see cref="IBehaviour"/>.
|
|
/// </summary>
|
|
int Priority { get; set; }
|
|
|
|
readonly record struct PriorityChangedArguments(int PreviousPriority);
|
|
}
|