/// <summary> /// Primary worker for the event factory, pulled into it's own method here so all the trigger event types can call it. /// This will attach the random event game Windows and then fire an event to trigger the event execution in that /// Windows /// then it will be able to display any relevant data about what happened. /// </summary> /// <param name="sourceEntity">Entities which will be affected by event if triggered.</param> /// <param name="directorEvent">Created instance of event that will be executed on simulation in random game Windows.</param> private void ExecuteEvent(IEntity sourceEntity, EventProduct directorEvent) { // Attach random event game Windows before triggering event since it will listen for it using event delegate. GameSimulationApp.Instance.WindowManager.Add(typeof(RandomEvent)); // Fire off event so primary game simulation knows we executed an event with an event. OnEventTriggered?.Invoke(sourceEntity, directorEvent); }
public bool PreFilterMessage(ref Message m) { if (m.Msg == this.EventId) { OnEventTriggered?.Invoke(this, this.EventId); return(true); } return(false); }
public void UnSubscribeAllEvents() // TODO - check it { if (OnEventTriggered == null) { return; } for (var index = OnEventTriggered.GetInvocationList().Length - 1; index >= 0; index--) { OnEventTriggered -= OnEventTriggered?.GetInvocationList()[index] as EventHandler; } }
public void TriggerEvents() { OnEventTriggered?.Invoke(); }
/// <summary> /// Attaches the event to the screen and executes its function. /// </summary> /// <param name="gameEntity">Game entity that will be effected by the event.</param> /// <param name="eventProduct">Instance of an event to execute.</param> private void ExecuteEvent(IEntity gameEntity, EventProduct eventProduct) { // Attach the base event screen then triggering the event. GameCore.Instance.WindowManager.Add(typeof(Event)); OnEventTriggered?.Invoke(gameEntity, eventProduct); }
public void TriggerEvents(T _value) { OnEventTriggered?.Invoke(_value); }
private void _bworker_ProgressChanged(object sender, ProgressChangedEventArgs e) => OnEventTriggered?.Invoke();
public void TriggerEvent(EventType eventType, IEventData trigger, ref byte[] arrayData) { OnEventTriggered?.Invoke(eventType, trigger, ref arrayData); }
public void TriggerEvent(bool loggable, ref byte[] arrayData) { OnEventTriggered?.Invoke(loggable, ref arrayData); }
public void TriggerEvent(RobotEventType eventType, IEventData eventData) { OnEventTriggered?.Invoke(eventType, eventData); }