/// <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);
        }
Esempio n. 2
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);
        }