예제 #1
0
        public void BeginTournament() {

            
            foreach (var firstPlayer in PlayersOfTornament)
            {
                foreach (var secondPlayer in PlayersOfTornament)
                {
                    if (firstPlayer == secondPlayer) continue;
                    this.gameEngine = new GameMachine(5, firstPlayer, secondPlayer);
                    this.gameEngine.RunMachine();

                    if (this.Rounds.ContainsKey(firstPlayer))
                    {
                        this.Rounds[firstPlayer] += this.gameEngine.P1Score;
                        continue;
                    }

                    if (this.Rounds.ContainsKey(secondPlayer))
                    {
                        this.Rounds[secondPlayer] += this.gameEngine.P2Score;
                        continue;
                    }

                    this.Rounds.Add(firstPlayer, this.gameEngine.P1Score);
                    this.Rounds.Add(secondPlayer, this.gameEngine.P2Score);
                }
            }         

        }    
예제 #2
0
        static void Main(string[] args)
        {
            Console.Write("Please Enter Iterations");
            string   value = Console.ReadLine();
            BaseGame game1 = new GameMachine(Int32.Parse(value), new HumanPlayer("Human"), new HumanPlayer("Human"));
            BaseGame game2 = new GameMachine(Int32.Parse(value), new HumanPlayer("Human"), new KindBot("KindBot"));
            BaseGame game3 = new GameMachine(Int32.Parse(value), new HumanPlayer("Human"), new EvilBot("EvilBot"));


            BaseGame game4 = new GameMachine(Int32.Parse(value), new KindBot("KindBot"), new GruderBot("GruderBot"));

            PressStartForFriendly(game4); // friendly
            PressStart();                 // tournament
        }