private static void RefreshBots()
        {
            if (Player1.Name == "AutomatedPlayer1")
            {
                Player1 = new AutomatedPlayer1("AutomatedPlayer1", Colours.White, Board);
            }
            else if (Player1.Name == "AutomatedPlayer2")
            {
                Player1 = new AutomatedPlayer2("AutomatedPlayer2", Colours.White, Board);
            }
            else if (Player1.Name == "AutomatedPlayer3A")
            {
                Player1 = new AutomatedPlayer3A("AutomatedPlayer3A", Colours.White, Board);
            }
            else if (Player1.Name == "AutomatedPlayer3B")
            {
                Player1 = new AutomatedPlayer3B("AutomatedPlayer3B", Colours.White, Board);
            }
            else if (Player1.Name == "Running Game Strategy")
            {
                Player1 = new RunningGamePlayer("RunningGamePlayer", Colours.White, Board);
            }
            else
            {
                Player1 = new BlitzPlayer("Blitz Player", Colours.White, Board);
            }



            if (Player2.Name == "AutomatedPlayer1")
            {
                Player2 = new AutomatedPlayer1("AutomatedPlayer1", Colours.Black, Board);
            }
            else if (Player2.Name == "AutomatedPlayer2")
            {
                Player2 = new AutomatedPlayer2("AutomatedPlayer2", Colours.Black, Board);
            }
            else if (Player2.Name == "AutomatedPlayer3A")
            {
                Player2 = new AutomatedPlayer3A("AutomatedPlayer3A", Colours.Black, Board);
            }
            else if (Player2.Name == "AutomatedPlayer3B")
            {
                Player2 = new AutomatedPlayer3B("AutomatedPlayer3B", Colours.Black, Board);
            }
            else if (Player2.Name == "Running Game Strategy")
            {
                Player2 = new RunningGamePlayer("RunningGamePlayer", Colours.Black, Board);
            }
            else
            {
                Player2 = new BlitzPlayer("Blitz Player", Colours.Black, Board);
            }

            Currentplayer = Player1;
            Game          = new Game(Player1, Player2, Currentplayer, Board);
        }
        private static void ChooseBots()
        {
            var player1type           = "";
            var player2type           = "";
            var player1botselection   = "";
            var player2botselection   = "";
            var botselectionrepeater1 = false;
            var botselectionrepeater2 = false;


            Console.WriteLine("Please select the bots that you will want to test aganist each other");
            Console.WriteLine("What type of bot would you like (b = basic bot, d = defensive bot, ad = advanced defensive bot, adb = advanced defensive bot B)");

            do
            {
                Console.WriteLine("Select Player 1s bot type :");
                player1botselection = Console.ReadLine();
                if (player1botselection.ToUpper() == "B")
                {
                    player1type           = "Basic Bot";
                    botselectionrepeater1 = true;
                }
                else if (player1botselection.ToUpper() == "D")
                {
                    player1type           = "Defensive Bot";
                    botselectionrepeater1 = true;
                }
                else if (player1botselection.ToUpper() == "AD")
                {
                    player1type           = "Advanced Defensive Bot";
                    botselectionrepeater1 = true;
                }
                else if (player1botselection.ToUpper() == "ADB")
                {
                    player1type           = "Advanced Defensive Bot B";
                    botselectionrepeater1 = true;
                }
                else if (player1botselection.ToUpper() == "RGS")
                {
                    player1type           = "Running Game Strategy";
                    botselectionrepeater1 = true;
                }

                else if (player1botselection.ToUpper() == "BP")
                {
                    player1type           = "Blitz Player";
                    botselectionrepeater1 = true;
                }
                else
                {
                    Console.WriteLine("Incorrect input restarting bot selection process");
                    botselectionrepeater1 = false;
                }
            } while (botselectionrepeater1 == false);


            do
            {
                Console.WriteLine("Select Player 2s bot type :");
                player2botselection = Console.ReadLine();
                if (player2botselection.ToUpper() == "B")
                {
                    player2type           = "Basic Bot";
                    botselectionrepeater2 = true;
                }
                else if (player2botselection.ToUpper() == "D")
                {
                    player2type           = "Defensive Bot";
                    botselectionrepeater2 = true;
                }
                else if (player2botselection.ToUpper() == "AD")
                {
                    player2type           = "Advanced Defensive Bot";
                    botselectionrepeater2 = true;
                }
                else if (player2botselection.ToUpper() == "ADB")
                {
                    player2type           = "Advanced Defensive Bot B";
                    botselectionrepeater2 = true;
                }
                else if (player2botselection.ToUpper() == "RGS")
                {
                    player2type           = "Running Game Strategy";
                    botselectionrepeater2 = true;
                }
                else if (player2botselection.ToUpper() == "BP")
                {
                    player2type           = "Blitz Player";
                    botselectionrepeater2 = true;
                }
                else
                {
                    Console.WriteLine("Incorrect input restarting bot selection process");
                    botselectionrepeater2 = false;
                }
            } while (botselectionrepeater2 == false);


            if (player1type == "Basic Bot")
            {
                Player1 = new AutomatedPlayer1("AutomatedPlayer1", Colours.White, Board);
            }
            else if (player1type == "Defensive Bot")
            {
                Player1 = new AutomatedPlayer2("AutomatedPlayer2", Colours.White, Board);
            }
            else if (player1type == "Advanced Defensive Bot")
            {
                Player1 = new AutomatedPlayer3A("AutomatedPlayer3A", Colours.White, Board);
            }
            else if (player1type == "Advanced Defensive Bot B")
            {
                Player1 = new AutomatedPlayer3B("AutomatedPlayer3B", Colours.White, Board);
            }
            else if (player1type == "Running Game Strategy")
            {
                Player1 = new RunningGamePlayer("Running Game Strategy", Colours.White, Board);
            }
            else
            {
                Player1 = new BlitzPlayer("Blitz Player", Colours.White, Board);
            }



            if (player2type == "Basic Bot")
            {
                Player2 = new AutomatedPlayer1("AutomatedPlayer1", Colours.Black, Board);
            }
            else if (player2type == "Defensive Bot")
            {
                Player2 = new AutomatedPlayer2("AutomatedPlayer2", Colours.Black, Board);
            }
            else if (player2type == "Advanced Defensive Bot")
            {
                Player2 = new AutomatedPlayer3A("AutomatedPlayer3A", Colours.Black, Board);
            }
            else if (player2type == "Advanced Defensive Bot B")
            {
                Player2 = new AutomatedPlayer3B("AutomatedPlayer3B", Colours.Black, Board);
            }
            else if (player2type == "Running Game Strategy")
            {
                Player2 = new RunningGamePlayer("Running Game Strategy", Colours.Black, Board);
            }
            else
            {
                Player2 = new BlitzPlayer("Blitz Player", Colours.Black, Board);
            }

            Currentplayer = Player1;
            Game          = new Game(Player1, Player2, Currentplayer, Board);
        }
Exemple #3
0
        private static void ChooseColors()
        {
            var player1type           = "";
            var player2type           = "";
            var player1colour         = Colours.Empty;
            var player2colour         = Colours.Empty;
            var player1name           = "";
            var player2name           = "";
            var selection             = false;
            var player1colourselect   = "";
            var repeater              = false;
            var player1botselection   = "";
            var player2botselection   = "";
            var botselectionrepeater1 = false;
            var botselectionrepeater2 = false;



            Console.WriteLine("This is the player selection area");
            Console.WriteLine("In this area you can select your colour,name and whether or not you want to play against a bot");
            do
            {
                Console.Write("For human vs human press H; For human vs bot press HB; For bot vs bot press B :");
                var playerselect = Console.ReadLine();
                if (playerselect.ToUpper() == "H")
                {
                    Console.WriteLine("You have selected human vs human!");
                    Console.Write("Are you a novice player Y/N :");
                    var input = Console.ReadLine();
                    if (input.ToUpper() == "Y")
                    {
                        Console.WriteLine("Enabling hints");
                        player1type = "Novice";
                        player2type = "Novice";
                        Console.WriteLine("You can now customize the players");
                        repeater = true;
                    }
                    else
                    {
                        Console.WriteLine("You can now customize the players");
                        player1type = "Human";
                        player2type = "Human";
                        repeater    = true;
                    }
                }
                else if (playerselect.ToUpper() == "B")
                {
                    Console.WriteLine("You have selected bot vs bot");
                    Console.WriteLine("You can now customize the players");
                    Console.WriteLine("What type of bot would you like (b = basic bot, d = defensive bot, ad = advanced defensive bot, adb = advanced defensive bot B, rgs = Running game strategy, bp = Blitz player)");
                    do
                    {
                        Console.Write("Select Player 1s bot type :");
                        player1botselection = Console.ReadLine();
                        if (player1botselection.ToUpper() == "B")
                        {
                            player1type           = "Basic Bot";
                            botselectionrepeater1 = true;
                        }
                        else if (player1botselection.ToUpper() == "D")
                        {
                            player1type           = "Defensive Bot";
                            botselectionrepeater1 = true;
                        }
                        else if (player1botselection.ToUpper() == "AD")
                        {
                            player1type           = "Advanced Defensive Bot";
                            botselectionrepeater1 = true;
                        }
                        else if (player1botselection.ToUpper() == "ADB")
                        {
                            player1type           = "Advanced Defensive Bot B";
                            botselectionrepeater1 = true;
                        }
                        else if (player1botselection.ToUpper() == "RGS")
                        {
                            player1type           = "Running Game Strategy";
                            botselectionrepeater1 = true;
                        }
                        else if (player1botselection.ToUpper() == "BP")
                        {
                            player1type           = "Blitz Player";
                            botselectionrepeater1 = true;
                        }
                        else
                        {
                            Console.WriteLine("Incorrect input restarting bot selection process");
                            botselectionrepeater1 = false;
                        }
                    } while (botselectionrepeater1 == false);


                    do
                    {
                        Console.Write("Select Player 2s bot type :");
                        player2botselection = Console.ReadLine();
                        if (player2botselection.ToUpper() == "B")
                        {
                            player2type           = "Basic Bot";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "D")
                        {
                            player2type           = "Defensive Bot";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "AD")
                        {
                            player2type           = "Advanced Defensive Bot";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "ADB")
                        {
                            player2type           = "Advanced Defensive Bot B";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "RGS")
                        {
                            player2type           = "Running Game Strategy";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "BP")
                        {
                            player2type           = "Blitz Player";
                            botselectionrepeater2 = true;
                        }
                        else
                        {
                            Console.WriteLine("Incorrect input restarting bot selection process");
                            botselectionrepeater2 = false;
                        }
                    } while (botselectionrepeater2 == false);

                    repeater = true;
                }
                else if (playerselect.ToUpper() == "HB")
                {
                    Console.WriteLine("You have selected human vs bot");
                    Console.WriteLine("You can now customize the players");
                    Console.WriteLine("Are you a novice player Y/N :");
                    var input = Console.ReadLine();
                    if (input.ToUpper() == "Y")
                    {
                        Console.WriteLine("Enabling hints");
                        player1type = "Novice";
                        Console.WriteLine("You can now customize the players");
                    }
                    else
                    {
                        player1type = "Human";
                    }

                    Console.WriteLine("Player 1 is human");
                    Console.WriteLine("What type of bot would you like (b = basic bot, d = defensive bot, ad = advanced defensive bot, adb = advanced defensive bot B,rgs = Running game strategy,bp = Blitz player)");
                    do
                    {
                        Console.Write("Select Players bot type :");
                        player2botselection = Console.ReadLine();
                        if (player2botselection.ToUpper() == "B")
                        {
                            player2type           = "Basic Bot";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "D")
                        {
                            player2type           = "Defensive Bot";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "AD")
                        {
                            player2type           = "Advanced Defensive Bot";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "ADB")
                        {
                            player2type           = "Advanced Defensive Bot B";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "RGS")
                        {
                            player2type           = "Running Game Strategy";
                            botselectionrepeater2 = true;
                        }
                        else if (player2botselection.ToUpper() == "BP")
                        {
                            player2type           = "Blitz Player";
                            botselectionrepeater2 = true;
                        }
                        else
                        {
                            Console.WriteLine("Incorrect input restarting bot selection process");
                            botselectionrepeater2 = false;
                        }
                    } while (botselectionrepeater2 == false);
                    repeater = true;
                }
                else
                {
                    Console.WriteLine("Invalid selection restarting player selection process");
                    repeater = false;
                }
            } while (repeater == false);

            Console.Write("Name player 1 :");
            player1name = Console.ReadLine();
            Console.Write("Name player 2 :");
            player2name = Console.ReadLine();
            Console.WriteLine("Last step please pick a colour for player 1, player 2 will be the other colour!");

            do
            {
                Console.Write("Select colour (b = black, w = white) :");
                player1colourselect = Console.ReadLine();
                if (player1colourselect == "b")
                {
                    selection = true;
                }
                else if (player1colourselect == "w")
                {
                    selection = true;
                }
                else
                {
                    selection = false;
                }
            } while (selection == false);


            if (player1colourselect == "b")
            {
                Console.WriteLine("PLayer 1 has selected Black");
                player1colour = Colours.Black;
                Console.WriteLine("Player 2 is the colour White");
                player2colour = Colours.White;
            }
            else
            {
                Console.WriteLine("PLayer 1 has selected White");
                player1colour = Colours.White;
                Console.WriteLine("Player 2 is the colour Black");
                player2colour = Colours.Black;
            }
            if (player1type == "Human")
            {
                Player1 = new HumanPlayer(player1name, player1colour, Board);
            }
            else if (player1type == "Novice")
            {
                Player1 = new NovicePlayer(player1name, player1colour, Board);
            }
            else if (player1type == "Basic Bot")
            {
                Player1 = new AutomatedPlayer1(player1name, player1colour, Board);
            }
            else if (player1type == "Defensive Bot")
            {
                Player1 = new AutomatedPlayer2(player1name, player1colour, Board);
            }
            else if (player1type == "Advanced Defensive Bot")
            {
                Player1 = new AutomatedPlayer3A(player1name, player1colour, Board);
            }
            else if (player1type == "Advanced Defensive Bot B")// ADDD IN IF STATEMENTS FOR IF
            {
                Player1 = new AutomatedPlayer3B(player1name, player1colour, Board);
            }
            else if (player1type == "Running Game Strategy")
            {
                Player1 = new RunningGamePlayer(player1name, player1colour, Board);
            }
            else
            {
                Player1 = new BlitzPlayer(player1name, player1colour, Board);
            }


            if (player2type == "Human")
            {
                Player2 = new HumanPlayer(player2name, player2colour, Board);
            }
            else if (player2type == "Novice")
            {
                Player2 = new NovicePlayer(player2name, player2colour, Board);
            }
            else if (player2type == "Basic Bot")
            {
                Player2 = new AutomatedPlayer1(player2name, player2colour, Board);
            }
            else if (player2type == "Defensive Bot")
            {
                Player2 = new AutomatedPlayer2(player2name, player2colour, Board);
            }
            else if (player2type == "Advanced Defensive Bot")
            {
                Player2 = new AutomatedPlayer3A(player2name, player2colour, Board);
            }
            else if (player2type == "Advanced Defensive Bot B")
            {
                Player2 = new AutomatedPlayer3B(player2name, player2colour, Board);
            }
            else if (player2type == "Running Game Strategy")
            {
                Player2 = new RunningGamePlayer(player2name, player2colour, Board);
            }
            else
            {
                Player2 = new BlitzPlayer(player2name, player2colour, Board);
            }

            Currentplayer = Player1;


            Game = new Game(Player1, Player2, Currentplayer, Board);

            BoardOutputter();
        }