public void Start()
        {
            FieldFactory minesweeperFactory = new MinesweeperFieldFactory();
            IField minesweeperField = minesweeperFactory.CreateField();

            FieldFactory playingFieldFactory = new PlayingFieldFactory();
            IField playingField = playingFieldFactory.CreateField();

            IRenderer consoleRenderer = new ConsoleRenderer();
            IReadInput inputReader = new ConsoleReader();
            IScoreBoard scoreboard = new ScoreBoard();

            IEngine engine = new Engine(minesweeperField, playingField, consoleRenderer, inputReader, scoreboard);
            engine.Play();
        }
예제 #2
0
        public static void Main(string[] args)
        {
            GameField gameField = new GameField(10,10);

            char[,] playingField = gameField.Create();
            char[,] bombsField = gameField.PlaceBombs();

            int maxScore = (gameField.FieldCols * gameField.FieldCols) -
                           (gameField.FieldCols + gameField.FieldCols);

            Engine engine = new Engine();

            while (true)
            {
                if (Engine.IsNewGame)
                {
                    playingField = gameField.Create();
                    bombsField = gameField.PlaceBombs();

                    Draw.GameLoad();
                    Draw.PlayingField(playingField);
                }

                Console.Write("Enter row and column: ");
                string inputCommand = Console.ReadLine();

                if (inputCommand == "exit")
                {
                    break;
                }

                inputCommand = engine.ParseInputCommand(inputCommand, playingField);

                engine.ExecuteCommand(inputCommand, gameField, playingField, bombsField, maxScore);
            }

            Console.WriteLine("Press any key to exit the game.");
            Console.Read();
        }
예제 #3
0
 static void Main()
 {
     Engine engine = new Engine();
     engine.Run();
 }
예제 #4
0
        // Entry point of the game.
        static void Main(string[] args)
        {
            Engine gameEngine = new Engine();

            gameEngine.Start();
        }
예제 #5
0
 internal static void Main()
 {
     IEngine engine = new Engine();
     engine.Play();
 }