public void StartStep() { if (!PMWrapper.IsCompilerRunning) { PMWrapper.StartCompiler(); } }
public void StartStep() { stepsLeft = p_steps; if (!PMWrapper.IsCompilerRunning) { PMWrapper.StartCompiler(); } }
public void RunProgram() { if (Main.Instance.LevelData.sandbox != null) { InitSandboxMode(); PMWrapper.StartCompiler(); } else { StartCorrection(); } }
public void RunAllCasesOrSandbox() { if (Main.instance.levelDefinition.sandbox != null) { InitSandboxMode(); PMWrapper.StartCompiler(); } else { StartCorrection(); } }
public void RunCase(int caseNumber) { CaseFlash.Instance.HideFlash(); if (numberOfCases > 1) { CaseFlash.Instance.ShowNewCaseFlash(CurrentCase, true); } else { PMWrapper.StartCompiler(); } }
// UITooltip Tooltip; public void OnRunCodeButtonClick() { if (PMWrapper.isCompilerRunning) { UISingleton.instance.walker.SetWalkerUserPaused(!PMWrapper.isCompilerUserPaused); } else if (LevelModeController.instance) { LevelModeController.instance.RunAllCasesOrSandbox(); } else { PMWrapper.StartCompiler(); } }
private IEnumerator ShowFlash(bool startCompilerWhenFinished) { foreach (Transform child in transform) { child.gameObject.SetActive(true); } yield return(new WaitForSeconds(Duration)); HideFlash(); if (startCompilerWhenFinished) { PMWrapper.StartCompiler(); } }
public bool IsStepDone() { if (!PMWrapper.IsCompilerRunning) { PMWrapper.StartCompiler(); } if (CodeWalker.ManusPlayerSaysICanContinue == false && stepsLeft > 0) { stepsLeft--; CodeWalker.ManusPlayerSaysICanContinue = stepsLeft > 0; } // This step is ready when we no longer need the walker to continue return(CodeWalker.ManusPlayerSaysICanContinue == false && stepsLeft == 0); }
/// <summary> /// Runs the code in the code window and asserts that the compiler does not take too long. /// <para>Note: Do not yield the direct return value of this method. /// Save it to a variable and iterate it manually and yield the current value <see cref="IEnumerator.Current"/> /// on the <see cref="IEnumerator"/></para> /// <example> /// IEnumerator coroutine = PlaygroundTestHelper.RunCaseAndAssert(data); /// while (coroutine.MoveNext()) /// { /// yield return coroutine.Current; /// } /// </example> /// </summary> public static IEnumerator RunCompilerWithTimeout(int timeoutMilliseconds, string messageFormat = null, params object[] args) { PMWrapper.StartCompiler(); var watch = Stopwatch.StartNew(); while (PMWrapper.isCompilerRunning) { if (watch.ElapsedMilliseconds > timeoutMilliseconds) { Assert.Fail(messageFormat != null ? "Compiler execution timeout! " + messageFormat : "Compiler execution timeout!", args); } yield return(null); } }