コード例 #1
0
        /// <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);
        }
コード例 #2
0
 public bool PreFilterMessage(ref Message m)
 {
     if (m.Msg == this.EventId)
     {
         OnEventTriggered?.Invoke(this, this.EventId);
         return(true);
     }
     return(false);
 }
コード例 #3
0
 public void TriggerEvents()
 {
     OnEventTriggered?.Invoke();
 }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
 public void TriggerEvents(T _value)
 {
     OnEventTriggered?.Invoke(_value);
 }
コード例 #6
0
 private void _bworker_ProgressChanged(object sender, ProgressChangedEventArgs e) => OnEventTriggered?.Invoke();
コード例 #7
0
 public void TriggerEvent(EventType eventType, IEventData trigger, ref byte[] arrayData)
 {
     OnEventTriggered?.Invoke(eventType, trigger, ref arrayData);
 }
コード例 #8
0
 public void TriggerEvent(bool loggable, ref byte[] arrayData)
 {
     OnEventTriggered?.Invoke(loggable, ref arrayData);
 }
コード例 #9
0
 public void TriggerEvent(RobotEventType eventType, IEventData eventData)
 {
     OnEventTriggered?.Invoke(eventType, eventData);
 }