Exemplo n.º 1
0
        public Player[] Italy()
        {
            Player[] team = new Player[11];

            Goalkeeper Buffon = new Goalkeeper("GianLuidgi","Buffon",10,10,12);

            Defender Chiellini = new Defender("Giorgio", "Chiellini",13,12,11);
            Defender DeRossi = new Defender("Daniele","De Rossi",14,10,12);
            Defender Bonucci = new Defender("Leonardo", "Bonucci",12,11,10);

            Midfielder Maggio = new Midfielder("Christian", "Maggio",13,12,10);
            Midfielder Marchisio = new Midfielder("Claudio", "Marchisio",13,11,11);
            Midfielder Pirlo = new Midfielder("Andrea", "Pirlo",14,9,12);
            Midfielder Motta = new Midfielder("Thiago", "Motta",12,10,12);
            Midfielder Giaccherini = new Midfielder("Emanuele", "Giaccherini",11,10,10);

            Striker Balotelli = new Striker("Mario", "Balotelli",9,11,12);
            Striker Cassano = new Striker("Antonio", "Cassano",11,9,12);

            team[0] = Buffon;
            team[1] = Chiellini;
            team[2] = DeRossi;
            team[3] = Bonucci;
            team[4] = Maggio;
            team[5] = Marchisio;
            team[6] = Pirlo;
            team[7] = Motta;
            team[8] = Giaccherini;
            team[9] = Balotelli;
            team[10] = Cassano;

            return team;
        }
Exemplo n.º 2
0
        public Player[] Croatia()
        {
            Player[] team = new Player[11];

            Goalkeeper Pletikosa = new Goalkeeper("Stipe", "Pletikosa", 10, 10, 11);

            Defender Srna = new Defender("Darjio", "Srna", 14, 11, 12);
            Defender Corluka = new Defender("Vedran", "Corluka", 12, 10, 12);
            Defender Schildenfeld = new Defender("Gordan", "Schildenfeld", 11, 13, 9);
            Defender Strinic = new Defender("Ivan", "Strinic", 13, 11, 10);

            Midfielder Vukojevic = new Midfielder("Ognien", "Vukojevic", 14, 11, 11);
            Midfielder Rakitic = new Midfielder("Ivan", "Rakitic", 11, 8, 12);
            Midfielder Modric = new Midfielder("Luka", "Modric", 14, 11, 12);
            Midfielder Perisic = new Midfielder("Ivan", "Perisic", 11, 10, 11);

            Striker Mandzukic = new Striker("Mario", "Mandzukic", 12, 12, 10);
            Striker Jelavic = new Striker("Nikica", "Jelavic", 11, 11, 11);

            team[0] = Pletikosa;
            team[1] = Srna;
            team[2] = Corluka;
            team[3] = Schildenfeld;
            team[4] = Strinic;
            team[5] = Vukojevic;
            team[6] = Rakitic;
            team[7] = Modric;
            team[8] = Perisic;
            team[9] = Mandzukic;
            team[10] = Jelavic;

            return team;
        }
        static void MatchPrediction(Player[] teamOne, Player[] teamTwo)
        {
            int summaryTeamOne = 0;
            foreach (var player in teamOne)
            {
                summaryTeamOne += player.Mental + player.Physical + player.Rating;

            }

            int summaryTeamTwo = 0;
            foreach (var player in teamTwo)
            {
                summaryTeamTwo += player.Mental + player.Physical + player.Rating;

            }

            Random rand = new Random();
            int luck = rand.Next(1,4);
            //Console.WriteLine(luck);

            if (luck==1)
            {
                summaryTeamOne+=10;
                Console.WriteLine("ITALY WINS");
            }
            else if (luck==2)
            {
                summaryTeamTwo += 10;
                Console.WriteLine("CROATIA WINS");
            }

            if (summaryTeamOne + 1 == summaryTeamTwo)
            {
                Console.WriteLine("DRAW");
            }

            // FOR FURTHER BRAINSTORMING

            //double formula = 1.5 * Math.Log(summaryTeamOne / summaryTeamTwo) + 0.45;
            //Console.WriteLine("dwwf   " + formula);
            //double preduction = 1 + Math.Pow((summaryTeamOne / summaryTeamTwo),2);
            //double result = (1 / preduction);
            //Console.WriteLine("{0}",result);
        }
 static void PrintPlayers(Player[] teamOne, Player[] teamTwo)
 {
     Console.WriteLine("ITALY");
     Console.WriteLine();
     foreach (var player in teamOne)
     {
         Console.WriteLine(player.FirstName +" "+ player.LastName + " Physical: " +player.Physical +
             " Mental "+ player.Mental + " Position Rating  " + player.Rating);
     }
     Console.WriteLine();
     Console.WriteLine("CROATIA");
     Console.WriteLine();
     foreach (var player in teamTwo)
     {
         Console.WriteLine(player.FirstName + " " + player.LastName + " Physical: " + player.Physical +
             " Mental " + player.Mental + " Position Rating  " + player.Rating);
     }
     Console.WriteLine();
 }