public void Init(MyObjectBuilder_GlobalEvents objectBuilder) { foreach (var eventBuilder in objectBuilder.Events) { m_globalEvents.Add(MyGlobalEventFactory.CreateEvent(eventBuilder)); } }
public void Init(MyObjectBuilder_GlobalEvents objectBuilder) { foreach (var eventBuilder in objectBuilder.Events) { m_globalEvents.Add(MyGlobalEventFactory.CreateEvent(eventBuilder)); } }
public static MyObjectBuilder_GlobalEvents GetObjectBuilder() { MyObjectBuilder_GlobalEvents objectBuilder = MyObjectBuilderSerializer.CreateNewObject <MyObjectBuilder_GlobalEvents>(); foreach (var globalEvent in m_globalEvents) { objectBuilder.Events.Add(globalEvent.GetObjectBuilder()); } return(objectBuilder); }
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 && globalEvent.IsHandlerValid) { m_globalEvents.Add(globalEvent); } } }
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 && globalEvent.IsHandlerValid) m_globalEvents.Add(globalEvent); } }