예제 #1
0
        public void InterruptEvent(InterruptAction interruptActionDone)
        {

            if (eventsRunning[interruptActions[interruptActionDone]])
            {
                eventsRunning[interruptActions[interruptActionDone]] = false;
            }
            
        }
예제 #2
0
        /// <summary>
        /// Loads the next interrupt into the games interrupt field.
        /// </summary>
        /// <returns>True if an interrupt was found.</returns>
        public bool CheckForInterrupt()
        {
            if (this.Interrupt != null)
            {
                return(true);
            }
            InterruptAction interrupt = null;

            if (!interrupts.IsEmpty)
            {
                interrupts = interrupts.Pop(out interrupt);
            }
            this.Interrupt = interrupt;
            return(this.Interrupt != null);
        }
예제 #3
0
 /// <summary>
 /// Adds an interrupt to the interrupt queue.
 /// These will take priority over the normal game flow,
 /// and will be executed sequentially until there are no
 /// more interrupts left in queue.
 /// </summary>
 /// <param name="interrupt"></param>
 public void AddInterrupt(InterruptAction interrupt)
 {
     interrupts = interrupts.Push(interrupt);
 }