AGS.Editor.Tasks.TestGame C# (CSharp) Метод

TestGame() публичный Метод

public TestGame ( bool withDebugger ) : void
withDebugger bool
Результат void
        public void TestGame(bool withDebugger)
        {
            string parameter = string.Empty;
            if (withDebugger)
            {
                parameter = "--enabledebugger " + Factory.AGSEditor.Debugger.InstanceIdentifier;
            }
            else if (Factory.AGSEditor.Preferences.TestGameStyle == TestGameWindowStyle.Windowed)
            {
                parameter = "-windowed";
            }
            else if (Factory.AGSEditor.Preferences.TestGameStyle == TestGameWindowStyle.FullScreen)
            {
                parameter = "-fullscreen";
            }
            _runningGameWithDebugger = withDebugger;

            RunEXEFile(Path.Combine(AGSEditor.DEBUG_OUTPUT_DIRECTORY, Factory.AGSEditor.BaseGameFileName + ".exe"), parameter, true);

            if (withDebugger)
            {
                Factory.AGSEditor.Debugger.InitializeEngine(Factory.AGSEditor.CurrentGame, Factory.GUIController.TopLevelWindowHandle);
            }
        }

Usage Example

Пример #1
0
        public void TestGame(bool withDebugger)
        {
            _mainGUIThread = new Control();
            IntPtr forceWindowHandleCreation = _mainGUIThread.Handle;

            _currentlyTesting = true;
            try
            {
                _tasks.TestGame(withDebugger);
            }
            catch (Exception ex)
            {
                Tasks_TestGameFinished(-1);
                throw new Exception(ex.Message, ex);
            }

            if (TestGameStarting != null)
            {
                TestGameStarting();
            }
        }