Manual

Message

class in Doozy.Engine

Description

The Message class is a global messaging system.

Static Methods

  • public static void AddListener(string messageName, Action callback) – Adds a listener that triggers the given callback when the message with the given name is received

  • public static void AddListener<T>(Action<T> callback) where T : Message – Adds a listener that triggers the given callback when a message of the given type is received

  • public static void AddListener<T>(string messageName, Action<T> callback) where T : Message – Adds a listener that triggers the given callback when a message of the given type and name is received

  • public static void RemoveListener(string messageName, Action callback) – Removes a listener that would trigger the given callback when a message with the given name is received

  • public static void RemoveListener<T>(Action<T> callback) where T : Message – Removes a listener that would trigger the given callback when a message of the given type is received

  • public static void RemoveListener<T>(string messageName, Action<T> callback) where T : Message – Removes a listener that would trigger the given callback when a message of the given type is received

  • public static void Send(string messageName) – Sends a message of the given name

  • public static void Send<T>(T message) where T : Message – Sends a message of the given type

  • public static void Send<T>(string messageName, T message) where T : Message – Sends a message of the given name and type