Esempio n. 1
0
        public static void Start()
        {
            var renderer = new ConsoleRenderer();

            int gameMode = int.Parse(renderer.RenderMainMenu());

            var inputProvider = new ConsoleInputProvider();

            var chessEngine = new StandardTwoPlayerEngine(renderer, inputProvider);

            IGameInitializationStrategy gameInitializationStrategy;

            switch (gameMode)
            {
            case 1:
                gameInitializationStrategy = new StandardStartGameInitializationStrategy();
                chessEngine.Initialize(gameInitializationStrategy);
                chessEngine.Start();
                break;

            case 2:
                gameInitializationStrategy = new Chess960StandardStartGameInitializationStrategy();
                chessEngine.Initialize(gameInitializationStrategy);
                chessEngine.Start();
                break;
            }



            Console.ReadLine();
        }
Esempio n. 2
0
        public static void Start()
        {
            Console.WriteLine("Would you like to play Chess960?(y/n)");
            string input    = Console.ReadLine();
            bool   chess960 = false;

            if (input.ToLower() == "y")
            {
                chess960 = true;
            }
            var renderer = new ConsoleRenderer();

            renderer.RenderMainMenu();

            var inputProvider = new ConsoleInputProvider();

            var chessEngine = new StandardTwoPlayerEngine(renderer, inputProvider);

            var gameInitializationStrategy = new StandardStartGameInitializationStrategy();

            chessEngine.Initialize(gameInitializationStrategy, chess960);
            chessEngine.Start();

            Console.ReadLine();
        }
Esempio n. 3
0
        static void Init()
        {
            // wrapper
            var container = new ContainerConsole();

            Global.CurrentScreen = container;

            // start the game
            var chessEngine = new StandardTwoPlayerEngine(container);
            var gameInitializationStrategy = new StandardStartGameInitializationStrategy();

            chessEngine.Initialize(gameInitializationStrategy);
        }
Esempio n. 4
0
        public static void Start()
        {
            IRenderer      renderer      = new ConsoleRenderer();
            IInputProvider inputProvider = new ConsoleInputProvider();

            renderer.RenderMainMenu();

            IChessEngine chessEngine             = new StandardTwoPlayerEngine(renderer, inputProvider);
            IGameInitializationStrategy strategy = new StandardStartGameInitializationStrategy();

            chessEngine.Initialize(strategy);
            chessEngine.Start();
        }
        public static void Start()
        {
            var renderer = new ConsoleRenderer();

            renderer.RenderMainMenu();

            var inputProvider = new ConsoleInputProvider();

            var gameEngine = new StandardTwoPlayerEngine(renderer, inputProvider);

            var gameInitializationStrategy = new StandardStartGameInitializationStrategy();

            gameEngine.Initialize(gameInitializationStrategy);
            gameEngine.Start();
        }
Esempio n. 6
0
        public static void Start()
        {
            var renderer = new ConsoleRenderer();


            var inputProvider = new ConsoleInputProvider();

            var chessEngine = new StandardTwoPlayerEngine(renderer, inputProvider);

            var gameInitializationStrategy = new StandardStartGameInitializationStrategy();

            chessEngine.Initialize(gameInitializationStrategy);
            chessEngine.Start();

            Console.ReadLine();
        }
Esempio n. 7
0
        public static void Start()
        {
            ConsoleHelpers.SetConsoleAndBufferWidthAndHeigth();
            Console.Title = "ChessGame";

            IRenderer renderer = new ConsoleRenderer();

            renderer.RenderMainMenu();

            IInputProvider inputProvider = new ConsoleInputProvider();
            IGameInitializationStrategy gameInitializationStrategy = new StandardStartGameInitializationStrategy();

            IChessEngine chessEngine = new StandardTwoPlayerEngine(renderer, inputProvider);

            chessEngine.Initialize(gameInitializationStrategy);
            chessEngine.Start();
        }