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;
        }
        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;
        }
        public Player GetPlayer(Players player, Valuta valuta)
        {
            Goalkeeper newPlayer = new Goalkeeper();

            newPlayer.Id           = player.ID_Player;
            newPlayer.Acceleration = player.Acceleration;
            newPlayer.Aerial       = player.Aerial;
            newPlayer.Age          = player.Age;
            newPlayer.Aggression   = player.Aggression;
            newPlayer.Agility      = player.Agility;
            newPlayer.Anticipation = player.Anticipation;
            newPlayer.Balance      = player.Balance;
            newPlayer.Bravery      = player.Bravery;
            newPlayer.Club         = new ViewModels.Club
            {
                Name     = player.Clubs.ClubName,
                Division = new ViewModels.Division
                {
                    Name   = player.Clubs.Divisions.DivisionName,
                    Nation = player.Clubs.Divisions.Based
                }
            };
            newPlayer.CommandOfArea   = player.Command_of_area;
            newPlayer.Communication   = player.Communication;
            newPlayer.Composure       = player.Composure;
            newPlayer.Concentration   = player.Concentration;
            newPlayer.Decisions       = player.Decisions;
            newPlayer.Determination   = player.Determination;
            newPlayer.Eccentricity    = player.Eccentricity;
            newPlayer.FirstTouch      = player.First_touch;
            newPlayer.Handling        = player.Handling;
            newPlayer.Height          = player.Hight;
            newPlayer.JumpingReach    = player.Jumping;
            newPlayer.Kicking         = player.Kicking;
            newPlayer.Leadership      = player.Leadership;
            newPlayer.Name            = player.Name;
            newPlayer.Nationality     = player.Nationality;
            newPlayer.NaturalFitness  = player.Natural_fitness;
            newPlayer.OffTheBall      = player.Off_the_ball;
            newPlayer.OneOnOne        = player.One_on_one;
            newPlayer.Pace            = player.Pace;
            newPlayer.Passing         = player.Passing;
            newPlayer.Position        = player.Position;
            newPlayer.Positioning     = player.Positioning;
            newPlayer.Reflexes        = player.Reflexes;
            newPlayer.Flair           = player.Flair;
            newPlayer.RushingOut      = player.Rushing_out;
            newPlayer.Stamina         = player.Stamina;
            newPlayer.Strength        = player.Strentgh;
            newPlayer.Teamwork        = player.Teamwork;
            newPlayer.TendencyToPunch = player.Tendency_to_punch_ball;
            newPlayer.Throwing        = player.Thowing;
            newPlayer.Value           = (int)valuta.Convert(DataCleaner.ConvertValueToNumber(player.Value));
            newPlayer.Vision          = player.Vision;
            newPlayer.Weight          = player.Weight;
            newPlayer.Workrate        = player.Workrate;
            return(newPlayer);
        }
        public override int GetHashCode()
        {
            var hashCode = -1413490195;

            hashCode = hashCode * -1521134295 + Sum.GetHashCode();
            hashCode = hashCode * -1521134295 + Experiences.GetHashCode();
            hashCode = hashCode * -1521134295 + Stamina.GetHashCode();
            hashCode = hashCode * -1521134295 + Goalkeeper.GetHashCode();
            hashCode = hashCode * -1521134295 + Tackling.GetHashCode();
            hashCode = hashCode * -1521134295 + Header.GetHashCode();
            hashCode = hashCode * -1521134295 + Winger.GetHashCode();
            hashCode = hashCode * -1521134295 + Creativity.GetHashCode();
            hashCode = hashCode * -1521134295 + Passing.GetHashCode();
            hashCode = hashCode * -1521134295 + Attacker.GetHashCode();
            return(hashCode);
        }
Esempio n. 5
0
        public static List <Goalkeeper> GenerateGoalkeepers(int numberOFPlayers)
        {
            int i = 0;
            List <Goalkeeper> listGoalkeeper = new List <Goalkeeper>(numberOFPlayers);

            while (i < numberOFPlayers)
            {
                var        random           = new Random();
                int        indexOfFirstName = random.Next(Constants.FIRST_NAMES.Length);
                int        indexOfLastName  = random.Next(Constants.FIRST_NAMES.Length);
                Goalkeeper newGoalkeeper    = new Goalkeeper(Constants.FIRST_NAMES[indexOfFirstName], Constants.LAST_NAMES[indexOfLastName], random.Next(Constants.MIN_PLAYER_AGE, Constants.MAX_PLAYER_AGE), random.Next(Constants.MIN_PLAYER_COMPOSURE, Constants.MAX_PLAYER_COMPOSURE), random.Next(Constants.MIN_PLAYER_WORK_RATE, Constants.MAX_PLAYER_COMPOSURE), random.Next(Constants.MIN_GK_SKILL, Constants.MAX_GK_SKILL), "");
                listGoalkeeper.Add(newGoalkeeper);
                i++;
            }
            return(listGoalkeeper);
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            const int playtime = 180;

            Player p1 = new Striker("Jugador1", 200, 12, 3);

            GetRank(p1, playtime);

            Player p2 = new Striker("Jugador2", 300, 10, 10);

            GetRank(p2, playtime);

            Player p3 = new Goalkeeper("Portero1", 300, 5, 8);

            GetRank(p3, playtime);

            Player p4 = new Goalkeeper("Portero2", 400, 11, 6);

            GetRank(p4, playtime);

            Console.ReadKey();
        }
Esempio n. 7
0
        // false = no goal, true = goal
        public static bool CalculateShotIsGoal(string ShotDirection, string GoalkeeperDirection, Goalkeeper gk, Striker st)
        {
            Random rand = new Random();
            int    AccuracyAndComposure = (st.GetStrikerAccuracy() * st.GetPlayerComposure()) / (10 * (Constants.MAX_PLAYER_COMPOSURE - st.GetPlayerComposure()));

            if (rand.Next(1, 20) > AccuracyAndComposure)
            {
                Console.WriteLine("Striker missed.");
                return(false);
            }
            else if ((GoalkeeperDirection == ShotDirection) && (rand.Next(1, 10) < (gk.GetGoalkeeperSkill() / 10)))
            {
                Console.WriteLine("The goalkeeper saved.");
                return(false);
            }
            return(true);
        }
 private void Awake()
 {
     goalkeeper = transform.GetComponentInChildren <Goalkeeper>();
 }