Пример #1
0
 public void Init(MyObjectBuilder_GlobalEvents objectBuilder)
 {
     foreach (var eventBuilder in objectBuilder.Events)
     {
         m_globalEvents.Add(MyGlobalEventFactory.CreateEvent(eventBuilder));
     }
 }
Пример #2
0
        public static void LoadEvents(MyObjectBuilder_GlobalEvents eventsBuilder)
        {
            if (eventsBuilder == null) return;

            foreach (var globalEventBuilder in eventsBuilder.Events)
            {
                MyGlobalEventBase globalEvent = MyGlobalEventFactory.CreateEvent(globalEventBuilder);

                Debug.Assert(globalEvent == null || globalEvent.IsHandlerValid, "Event handler could not be found on load. Call a programmer please! You can ignore this, if you don't mind the given event not happening.");
                if (globalEvent != null)
                    m_globalEvents.Add(globalEvent);
            }
        }