예제 #1
0
파일: Program.cs 프로젝트: xTomluca/ProLab2
        static void Main(string[] args)
        {
            Equipo          e     = new Equipo(5, "Moreno FC");
            Jugador         j1    = new Jugador(39113917, "Tomas", 10, 2);
            Jugador         j2    = new Jugador(11391129, "Luca", 8, 3);
            Jugador         j3    = new Jugador(15445284, "Luis", 4, 3);
            Jugador         j4    = new Jugador(15445284, "Clon", 2, 3);
            Jugador         j5    = new Jugador(11391442, "Matias", 12, 3);
            Jugador         j6    = new Jugador(11291139, "Wos", 14, 3);
            Jugador         j7    = new Jugador(14725836, "Doki", 27, 3);
            DateTime        fecha = new DateTime(1995, 08, 11);
            DirectorTecnico d1    = new DirectorTecnico("Sampoaoli", fecha);

            Console.WriteLine(d1.MostrarDatos());
            if (e + j1)
            {
                Console.WriteLine("Jugador creado");
            }
            if (e + j2)
            {
                Console.WriteLine("Jugador creado");
            }
            if (e + j3)
            {
                Console.WriteLine("Jugador creado");
            }
            if (e + j4)
            {
                Console.WriteLine("Jugador creado");
            }
            else
            {
                Console.WriteLine("Jugador DUPLICADO");
            }
            if (e + j5)
            {
                Console.WriteLine("Jugador creado");
            }
            if (e + j6)
            {
                Console.WriteLine("Jugador creado");
            }
            if (e + j7)
            {
                Console.WriteLine("Jugador creado");
            }
            Console.Write("\n");
            Console.WriteLine(e.Mostrar());
            Console.Write("\n");
            foreach (Jugador aux in e.jugadores)
            {
                Console.WriteLine(aux.MostrarDatos());
                Console.Write("\n");
            }

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            DateTime t = new DateTime(1996, 10, 05);

            t.ToString("dd/MM/yyyy");
            DirectorTecnico d1 = new DirectorTecnico("Hernan", t);

            d1.Dni = 39664999;
            Console.Write("\t\tDirector Tecnico");
            Console.WriteLine(d1.MostrarDatos());

            Jugador j1 = new Jugador("Lautaro", 20, 100);

            j1.Dni = 38458999;
            Console.Write("\n\n\t\tJugador 1");
            Console.WriteLine(j1.MostrarDatos());

            Jugador j2 = new Jugador("Alen", 93, 85);

            j2.Dni = 39544788;
            Console.Write("\n\n\t\tJugador 2");
            Console.WriteLine(j2.MostrarDatos());

            Equipo e1 = new Equipo(11, "Boca Juniors");

            if (e1 + j1)
            {
                Console.WriteLine("\nJugador 1 agregado al equipo!");
            }
            else
            {
                Console.WriteLine("No se pudo agregar!");
            }

            if (e1 + j2)
            {
                Console.WriteLine("\nJugador 2 agregado al equipo!");
            }
            else
            {
                Console.WriteLine("No se pudo agregar!");
            }

            Console.ReadKey();
        }
예제 #3
0
        static void Main(string[] args)
        {
            Equipo          Barca       = new Equipo(11, "Barcelona");
            Jugador         lionelMessi = new Jugador(18035241, "Messi", 75, 20);
            Jugador         luisSuarez  = new Jugador(18035, "Suarez", 51, 30);
            Jugador         xavi        = new Jugador(18035261, "Xavi", 58, 38);
            DirectorTecnico simeone     = new DirectorTecnico(42052, "Simeone", new DateTime(1999, 5, 4));
            DirectorTecnico guardeola   = new DirectorTecnico(42456452, "Simeone", new DateTime(1999, 5, 4));//va al MostrarDatos() de Persona

            bool retorno1 = Barca + lionelMessi;
            bool retorno2 = Barca + luisSuarez;
            bool retorno3 = Barca + xavi;

            Console.WriteLine(simeone.MostrarDatos());
            Console.WriteLine(" ");

            if (retorno1 == true && retorno2 == true && retorno3 == true)
            {
                Console.WriteLine("Se agrego el jugador:\n{0}\n{1}\n{2}", lionelMessi.MostrarDatos(), luisSuarez.MostrarDatos(), xavi.MostrarDatos());
            }
            else
            {
                Console.WriteLine("Se exedio el limite de jugadores por equipo");
            }
            if (lionelMessi == luisSuarez)
            {
                Console.WriteLine("Tienen el mismo dni");
            }
            else
            {
                Console.WriteLine("NO son iguales");
            }
            if (simeone == guardeola)
            {
                Console.WriteLine("Son iguales");
            }
            else
            {
                Console.WriteLine("NO SON IGUALES");
            }
            Console.ReadKey();
        }
예제 #4
0
        static void Main(string[] args)
        {
            List <Jugador> jugadores = new List <Jugador>();

            jugadores.Add(new Jugador(41321674, "Matias", 45, 33));
            jugadores.Add(new Jugador(41321344, "Emiliano", 3, 23));
            jugadores.Add(new Jugador(41721874, "Marcos", 23, 34));
            jugadores.Add(new Jugador(41341274, "Warren", 65, 21));
            jugadores.Add(new Jugador(41092674, "Jones", 12, 15));
            jugadores.Add(new Jugador(41435164, "Barnes", 34, 72));
            jugadores.Add(new Jugador(41321544, "Jackson", 9, 56));
            jugadores.Add(new Jugador(41329817, "West", 15, 66));
            jugadores.Add(new Jugador(42839382, "Mason", 17, 32));
            jugadores.Add(new Jugador(42839382, "Mason", 17, 32));
            jugadores.Add(new Jugador(43321674, "Morgan", 19, 45));
            jugadores.Add(new Jugador(44987454, "Henry", 98, 11));
            jugadores.Add(new Jugador(49388473, "Ortiz", 2, 1));
            Equipo equipo = new Equipo(11, "lanus");

            foreach (Jugador jugador in jugadores)
            {
                if (equipo + jugador)
                {
                    Console.Write(jugador.MostrarDatos());
                    Console.WriteLine("Jugador agregado");
                }
                else
                {
                    Console.Write(jugador.MostrarDatos());
                    Console.WriteLine("Jugador rechazado");
                }
                Console.WriteLine("");
            }

            DirectorTecnico directorTecnico = new DirectorTecnico("Mourinio", DateTime.Today);

            Console.WriteLine(directorTecnico.MostrarDatos());

            Console.ReadKey();
        }