Example #1
0
        internal Game(GameMode mode, bool isRedHuman)
        {
            GameMode = mode;
            Board = new Board();

            Player1 = new Player(GameColor.White, true);
            Player2 = new Player(GameColor.Red, isRedHuman);

            PlayNextTurn();
        }
Example #2
0
        internal Turn(Player player)
        {
            Player = player;

            var dice = new Random();
            DiceResult1 = dice.Next(1,6);
            DiceResult2 = dice.Next(1, 6);

            CalculatePossibleMoves();           
        }
Example #3
0
        internal Game(GameRecreation recreation)
        {
            GameMode = recreation.GameMode;

            CurrentTurn = recreation.CurrentTurn;

            Board = recreation.Board;

            Player1 = new Player(GameColor.White, true);
            Player2 = new Player(GameColor.Red, recreation.IsRedHuman);

            CurrentTurn.Player = recreation.CurrentColor == GameColor.White ? Player1 : Player2;
        }
Example #4
0
        private static void PrintPlayerName(Player player)
        {
            var color = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), player.PlayerColor.ToString());

            if (color == ConsoleColor.White)
            {
                Console.ForegroundColor = ConsoleColor.Black;
                Console.BackgroundColor = ConsoleColor.White;
                Console.Write(player);
                Console.ResetColor();
                return;
            }
            Console.ForegroundColor = ConsoleColor.Red;
            Console.Write(player);
            Console.ResetColor();
        }