示例#1
0
 private void EndGame(int score)
 {
     GameServices.PrintResults(this.gameField);
     Console.WriteLine("Game over. Detonated mines: {0}", score);
     Console.WriteLine("Press any key to exit");
     Console.ReadKey();
 }
示例#2
0
        private void GameLoop()
        {
            int blownMines = 0;

            while (GameServices.ContainsMines(this.gameField))
            {
                GameServices.PrintResults(this.gameField);
                Position2D inputPosition = GetMoveInput();
                if (GameServices.IsValidMove(this.gameField, inputPosition.X, inputPosition.Y))
                {
                    GameServices.Explode(this.gameField, inputPosition);
                    blownMines++;
                }
                else
                {
                    Console.WriteLine("Invalid move!");
                }
            }

            EndGame(blownMines);
        }