Exemple #1
0
 /// <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);
 }
Exemple #2
0
 /// <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));
 }
Exemple #3
0
 /// <summary>
 /// Clears the GameEvent delegate
 /// </summary>
 public static void Clear <T>() where T : IGameEvent
 {
     EventManagerInternal <T> .Clear();
 }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 /// <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);
 }
Exemple #6
0
 /// <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);
 }