Example #1
0
 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);
     }
 }
Example #2
0
 public void RegisterSystem(Subsystem sys)
 {
     Systems.Add(sys);
     if (sys is IRenderer)
         RenderSystems.Add((IRenderer)sys);
 }
Example #3
0
 private static void SendMessage(Message msg, Subsystem sys)
 {
     sys.Messages.AddMessage(msg);
 }