public static void AddListener(Subsystem sys, params Type[] types) { foreach (Type t in types) { List<Subsystem> systems; listeners.TryGetValue(t, out systems); if (systems == null) listeners[t] = new List<Subsystem>() { sys }; else listeners[t].Add(sys); } }
public void RegisterSystem(Subsystem sys) { Systems.Add(sys); if (sys is IRenderer) RenderSystems.Add((IRenderer)sys); }
private static void SendMessage(Message msg, Subsystem sys) { sys.Messages.AddMessage(msg); }