/// <summary> /// Use this function to define an interrupt you can call using the i command /// </summary> /// <param name="f">The Interrupt to be executed</param> /// <param name="where">Number to be given</param> public void DefineInterrupt(Action f, int where) { for (var i = 0; RegisterInterrupt.Count <= where; i++) { if (RegisterInterrupt.Count < i) { RegisterInterrupt.Add(EmptyInterrupt); } } RegisterInterrupt[where] = f; }
private void Interrupt(int i) { RegisterInterrupt[GetNFrom(i + 2)](); }