예제 #1
0
        private void StartLevel(int levelNumber)
        {
            Game level = new Game(levelNumber);

            bool won = false;

            while (!won)
            {
                OutputView.DrawLevel(level.Map, false);
                GameAction action = InputView.AwaitActionGame();

                if (action == GameAction.Stop)
                {
                    break;
                }
                else if (action != GameAction.Invalid)
                {
                    level.ApplyAction(action);

                    won = level.HasWon();
                }
            }

            if (won)
            {
                OutputView.DrawLevel(level.Map, true);
                InputView.AwaitAnyKey();
            }
        }