public string Compile(CompilerContext context) { context.EnterNewScope("For loop"); CurrentIndex.Value = LowerBound; string code = $"for {CurrentIndex.Compile(context)}, {UpperBound.Compile(context)} do\n" + LoopBody.Compile(context) + "\n" + $"end\n" + LoopEnd.Compile(context) + "\n"; context.LeaveScope(); return(code); }
/// <summary> /// Fires the loop end event /// </summary> private void FireLoopEnd() { LoopEnd?.Invoke(this, new GameAudioEventArgs()); }
void IXAudio2VoiceCallback.OnLoopEnd(IntPtr bufferContextPtr) { LoopEnd?.Invoke(this, new XAudio2BufferEventArgs(bufferContextPtr)); }