public void Execute()
        {
            _finishinfo = string.Format(
                _dataProvider.GetText("playerwins"),
                _dataProvider.GetNumberLiteral(_winner));
            _finishskull1 = string.Format(
                _dataProvider.GetText("finishskull1"));
            _finishskull2 = string.Format(
                _dataProvider.GetText("finishskull2"));

            while (isFinished)
            {
                _sourceWrapper.Clear();
                _sourceWrapper.WriteOutput(35, 0, _finishinfo, ConsoleColor.Green);
                _sourceWrapper.WriteOutput(0, 0, _finishskull1);
                _sourceWrapper.WriteOutput(35, 5, _finishskull2);
                _sourceWrapper.WriteOutput(73, 0, _finishskull1);

                _sourceWrapper.WriteOutput(35, 3, "Press any Key to leave", ConsoleColor.DarkGreen);
                Console.SetCursorPosition(57, 3);
                var input = _sourceWrapper.ReadKey();
                if (input != null)
                {
                    isFinished = false;
                    _game.SwitchState(new MainMenuState(_game));
                }
            }
        }
예제 #2
0
        private void UpdateOutput()
        {
            _sourceWrapper.Clear();
            //Game Info
            _sourceWrapper.WriteOutput(0, 0, _gameInfoOutput, ConsoleColor.DarkCyan);

            //Board Display
            _sourceWrapper.WriteOutput(40, 10, _boardOutput, ConsoleColor.Gray);

            //After Board Info
            _sourceWrapper.WriteOutput(0, 16, _afterBoardOutput, ConsoleColor.DarkCyan);


            //After Turn Info
            if (_afterTurnOutput.Length != 0)
            {
                _sourceWrapper.WriteOutput(0, 23, _afterTurnOutput, ConsoleColor.DarkCyan);
            }


            //Help Info
            if (_helpOutput.Length != 0)
            {
                _sourceWrapper.WriteOutput(30, 2, _helpOutput, ConsoleColor.Yellow);
            }


            //Last Input and Error
            if (_error.Length != 0)
            {
                _sourceWrapper.WriteOutput(0, 18, _lastInput, ConsoleColor.DarkRed);
                _sourceWrapper.WriteOutput(0, 19, _error, ConsoleColor.Red);
            }
        }
        private void UpdateOutput()
        {
            _sourceWrapper.Clear();
            _sourceWrapper.WriteOutput(0, 0, _mainMenuOutput, ConsoleColor.DarkCyan);
            _sourceWrapper.WriteOutput(0, 12, string.Empty);

            if (_additionalInformation.Length != 0)
            {
                _sourceWrapper.WriteOutput(0, 15, _additionalInformation, ConsoleColor.DarkCyan);
            }

            if (_error.Length != 0)
            {
                _sourceWrapper.WriteOutput(0, 12, "Last Input: " + _lastInput, ConsoleColor.DarkRed);
                _sourceWrapper.WriteOutput(0, 13, "Last Error: " + _error, ConsoleColor.Red);
            }
        }