Esempio n. 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (GameLoop game = new GameLoop())
     {
         game.Run();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (GameLoop game = new GameLoop())
     {
         game.Run();
     }
 }
Esempio n. 3
0
        public void Run(CancellationToken cancellation)
        {
            string[] inputs;
            var      gridSizeInput = _consoleInputOutput.ReadLine();

            inputs = gridSizeInput.Split(' ');
            int width  = int.Parse(inputs[0]); // size of the grid
            int height = int.Parse(inputs[1]); // top left corner is (x=0, y=0)

            var grid = new GameGrid();

            grid.StoreGrid(ReadGrid(height));

            var strategy = _actionStrategyFactory(grid);

            // game loop
            var loop = new GameLoop(_consoleInputOutput,
                                    cancellation,
                                    strategy,
                                    grid);

            loop.Run();
        }