/// <summary> /// Triggers a specific interruption type /// </summary> /// <param name="Type"></param> public void TriggerInterrupt(InterruptTypes Type) { if (!Flags.InterruptDisable || Type == InterruptTypes.NMI) { Interrupts[(int)Type] = true; } }
public override Type Interrupt(InterruptTypes interrupt) { if (interrupt == InterruptTypes.Dead) { return(typeof(State_Dead)); } return(null); }
public virtual Type Interrupt(InterruptTypes interrupt) { if (interrupt == InterruptTypes.Hit) { return(typeof(State_Stunned)); } else { return(typeof(State_Dead)); } }
public override Type Interrupt(InterruptTypes interrupt) { if (interrupt == InterruptTypes.Hit) { timer += enemy.StunTime; } else { return(typeof(State_Dead)); } return(null); }
/// <summary> /// Handle an interrupt of a specified type. /// </summary> /// <param name="aInterruptType">The interrupt type.</param> /// <param name="aVm"> /// The virtual machine instance in which the interrupt should be handled. /// </param> public static void Interrupt(InterruptTypes aInterruptType, VirtualMachine aVm) { if (!Handlers.TryGetValue(aInterruptType, out var handler)) { throw new Exception ( $"Interrupt: interrupt type " + $"{aInterruptType} has no registered handler." ); } handler.Handle(aVm); }
public void SendInterrupt(InterruptTypes interruptType) { var nextState = ActiveState.Interrupt(interruptType); SetState(nextState); }
public InterruptAttribute(InterruptTypes aInterruptType) { InterruptType = aInterruptType; }
public override Type Interrupt(InterruptTypes interrupt) => null;