From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- .../Events/Attributes/EventListenerAttribute.cs | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Impostor-dev/src/Impostor.Api/Events/Attributes/EventListenerAttribute.cs (limited to 'Impostor-dev/src/Impostor.Api/Events/Attributes') diff --git a/Impostor-dev/src/Impostor.Api/Events/Attributes/EventListenerAttribute.cs b/Impostor-dev/src/Impostor.Api/Events/Attributes/EventListenerAttribute.cs new file mode 100644 index 0000000..b31d2d1 --- /dev/null +++ b/Impostor-dev/src/Impostor.Api/Events/Attributes/EventListenerAttribute.cs @@ -0,0 +1,34 @@ +using System; + +namespace Impostor.Api.Events +{ + [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] + public class EventListenerAttribute : Attribute + { + public EventListenerAttribute(EventPriority priority = EventPriority.Normal) + { + Priority = priority; + } + + public EventListenerAttribute(Type @event, EventPriority priority = EventPriority.Normal) + { + Priority = priority; + Event = @event; + } + + /// + /// The priority of the event listener. + /// + public EventPriority Priority { get; set; } + + /// + /// The events that the listener is listening to. + /// + public Type? Event { get; set; } + + /// + /// If set to true, the listener will be called regardless of the . + /// + public bool IgnoreCancelled { get; set; } + } +} \ No newline at end of file -- cgit v1.1-26-g67d0