namespace Minecraft.Server.FourKit.Event;
///
/// Marks a method inside a as an event handler.
/// This class is not named "EventHandler" due to a naming conflict with the existing System.EventHandler
///
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class EventHandlerAttribute : Attribute
{
///
/// Priority of this handler. Lower values run first.
/// Default is .
///
public EventPriority Priority { get; set; } = EventPriority.Normal;
///
/// Whether this handler should be skipped when the event is already
/// cancelled by a lower-priority handler. Default is false.
///
public bool IgnoreCancelled { get; set; } = false;
}
///
/// Execution priority for event handlers.
///
public enum EventPriority
{
/// Event call is of very low importance and should be ran first, to allow other plugins to further customise the outcome
Lowest = 0,
/// Event call is of low importance
Low = 1,
/// Event call is neither important nor unimportant, and may be ran normally
Normal = 2,
/// Event call is of high importance
High = 3,
/// Event call is critical and must have the final say in what happens to the event
Highest = 4,
/// Event is listened to purely for monitoring the outcome of an event. Should not modify the event.
Monitor = 5
}