/// <summary> /// Rasies the game event 'e' to all handlers except the ones specified /// </summary> public static void RaiseToAllExcept <T>(T e, params Action <T>[] handlers) where T : IGameEvent { EventManagerInternal <T> .RaiseToAllExcept(e, handlers); }
/// <summary> /// Returns true if the specified handler is contained in the GameEvent's delegate invocation list /// </summary> public static bool Contains <T>(Action <T> handler) where T : IGameEvent { return(EventManagerInternal <T> .Contains(handler)); }
/// <summary> /// Clears the GameEvent delegate /// </summary> public static void Clear <T>() where T : IGameEvent { EventManagerInternal <T> .Clear(); }
/// <summary> /// Raise (fire) the GameEvent specified by the generic argument `T` /// </summary> /// <typeparam name="T">The type of GameEvent to be raised</typeparam> public static void Raise <T>(T e) where T : IGameEvent { EventManagerInternal <T> .Raise(e); }
/// <summary> /// Unubscribe (remove) a handler to the GameEvent specified by the generic argument `T` /// </summary> /// <typeparam name="T">The type of GameEvent to subscribe to</typeparam> /// <param name="handler">The handler to subscribe (the handler to be added)</param> public static void Unsubscribe <T>(Action <T> handler) where T : IGameEvent { EventManagerInternal <T> .Unsubscribe(handler); }
/// <summary> /// Handles the the GameEvent (specified by the generic argument 'T') by the specified handler /// Note: this will set the delegate directly to the handler so any previous subscribers will be unsubbed /// so you might want to use this if you want your event to be handled by a single handler /// </summary> public static void HandleEvent <T>(Action <T> handler) where T : IGameEvent { EventManagerInternal <T> .HandleEvent(handler); }