Esempio n. 1
0
        public GameLoop(ChessBoard.ChessBoard chessBoard)
        {
            _chessBoard = chessBoard;

            Setup();
            EnterGameLoop();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine(Environment.NewLine);
            Console.WriteLine("Welcome to LaserChess!");
            Console.WriteLine(Environment.NewLine);

            Console.WriteLine("Choose LaserChess board:");
            Console.WriteLine("1. First contact!");
            Console.WriteLine("2. Drone menace!");
            Console.WriteLine("3. 300 vs 4!");
            Console.WriteLine("or write 'exit' to quit LaserChess!");
            Console.WriteLine(Environment.NewLine);

            int levelPick = PickLevel();

            if (levelPick == 0)
            {
                Console.WriteLine("Quitting Laser Chess...");
                return;
            }

            string[] rawChessBoard;
            try
            {
                rawChessBoard = LoadLevelFromFile(levelPick);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                Console.ReadLine();
                return;
            }

            var chessBoard = new ChessBoard.ChessBoard();

            chessBoard.LoadLevel(rawChessBoard);

            var gameLoop = new GameLoop(chessBoard);

            Console.WriteLine(Environment.NewLine);
            Console.WriteLine("Quitting Laser Chess...");
            Console.ReadLine();
        }