static void Main(string[] args) { Equipo ferro = new Equipo(3, "Ferro"); Jugador j1 = new Jugador(1, "Joaquin", 10, 5); Jugador j2 = new Jugador(2, "Karen", 3, 4); Jugador j3 = new Jugador(3, "Pupi Salmeron", 5, 3); //Console.WriteLine(j1.MostrarDatos()); //Console.WriteLine(j2.MostrarDatos()); //Console.WriteLine(j3.MostrarDatos()); if (ferro + j1) { Console.WriteLine("Se agrego a {0} \n{1}", ferro.nombre, j1.MostrarDatos()); } else { Console.WriteLine("No lo pude agregar"); } if (ferro + j1) { Console.WriteLine("Se agrego a {0} \n{1}", ferro.nombre, j1.MostrarDatos()); } else { Console.WriteLine("No lo pude agregar"); } Console.ReadKey(); }
static void Main(string[] args) { Equipo equipo1 = new Equipo(11, "Barcelona"); Equipo equipo2 = new Equipo(11, "Juventus"); Jugador jugador1 = new Jugador(35462712, "Messi", 20, 10); Jugador jugador2 = new Jugador(35462712, "Messi", 30, 10); Jugador jugador3 = new Jugador(32262712, "Cristiano", 40, 10); if (equipo1 + jugador1) { Console.WriteLine("Se Agrego a Leo"); } if (!(equipo1 + jugador2)) { Console.WriteLine("no Se Agrego a Leo2"); } if (equipo1 + jugador3) { Console.WriteLine("Se Agrego a Ronaldo"); } Console.WriteLine(jugador1.MostrarDatos()); Console.WriteLine(jugador3.MostrarDatos()); Console.WriteLine(equipo1.ShowTeam()); Console.ReadKey(); }
static void Main(string[] args) { Jugador j1 = new Jugador(1, "primero"); Jugador j2 = new Jugador(2, "segundo"); Jugador j3 = new Jugador(3, "tercero"); Jugador j4 = new Jugador(1, "cuarto", 10, 100); Jugador j5 = new Jugador(5, "quinto"); Equipo e = new Equipo(4, "equipo"); bool b1 = e + j1; bool b2 = e + j2; bool b3 = e + j3; bool b4 = e + j4; bool b5 = e + j5; Console.WriteLine(b1 && b2 && b3 && b4); // True. Console.WriteLine(b5); // False. Console.WriteLine(j1 == j4); // True. Console.WriteLine(j1 == j2); // False. Console.WriteLine(j4.GetPromedioDeGol()); Console.WriteLine(j4.MostrarDatos()); Console.Read(); }
static void Main(string[] args) { Jugador j1 = new Jugador(38555448, "Juan", 2, 10); Jugador j2 = new Jugador(37885465, "Lucas", 10, 3); Jugador j3 = new Jugador(36998524, "Pablo", 4, 7); Equipo e = new Equipo(2, "Pablonoentra"); if (e + j1) { Console.WriteLine("Nuevo Jugador: " + j1.MostrarDatos()); } else { Console.WriteLine("No se pudo agregar el jugador"); } if (e + j2) { Console.WriteLine("Nuevo Jugador: " + j2.MostrarDatos()); } else { Console.WriteLine("No se pudo agregar el jugador"); } if (e + j3) { Console.WriteLine("Nuevo Jugador: " + j3.MostrarDatos()); } else { Console.WriteLine("No se pudo agregar el jugador"); } if (e + j1) { Console.WriteLine("Nuevo Jugador: " + j1.MostrarDatos()); } else { Console.WriteLine("No se pudo agregar el jugador"); } Console.ReadKey(); }
static void Main(string[] args) { Jugador mateo = new Jugador(414834789, "Mateo", 10, 5); mateo.GetPromedioGoles(); Console.WriteLine(mateo.MostrarDatos()); Console.ReadKey(); }
static void Main(string[] args) { Jugador j1 = new Jugador(41856345, "Juan Carlos", 5, 2); Console.WriteLine(j1.MostrarDatos()); Console.ReadKey(); }
static void Main(string[] args) { Console.Title = "Ejercicio 29"; Jugador j1 = new Jugador(28057192, "mariano", 5, 4); Jugador j2 = new Jugador(44052331, "valentin", 8, 3); Equipo e1 = new Equipo(11, "Barcelona"); //JUGADOR Console.WriteLine("************************"); Console.WriteLine("********JUGADOR*********"); Console.WriteLine("************************"); //GetPromedioGoles //Ejercicio 29 //Console.WriteLine("getprom j1: " + j1.GetPromedioGoles()); //Console.WriteLine("getprom j2: " + j2.GetPromedioGoles()); //Ejercicio 31 Console.WriteLine("getprom j1: " + j1.PromedioGoles); Console.WriteLine("getprom j2: " + j2.PromedioGoles); //MostrarDatos Console.WriteLine("mostrardatos j1: " + j1.MostrarDatos()); Console.WriteLine("mostrardatos j2: " + j2.MostrarDatos()); //== if (j1 == j2) { Console.WriteLine("j1 == j2"); } else { Console.WriteLine("j1 != j2"); } //EQUIPO Console.WriteLine("************************"); Console.WriteLine("*********EQUIPO*********"); Console.WriteLine("************************"); //public static bool operator +(Equipo e, Jugador j) //agrego jugador 1 if (e1 + j1) { Console.WriteLine("agrego j1"); } //agrego jugador 2 if (e1 + j2) { Console.WriteLine("agrego j2"); } Console.ReadKey(); }
static void Main(string[] args) { Jugador j1 = new Jugador(42395106, "ema", 10, 5); Jugador j2 = new Jugador(5064452, "lucas", 2, 8); Jugador j3 = new Jugador(4523433, "pepe", 10, 5); Jugador j4 = new Jugador(42395106, "ema", 10, 5); //igual al primer jugador Equipo e1 = new Equipo(2, "quilme"); //muestro datos de un jugador Console.WriteLine(j1.MostrarDatos()); Console.WriteLine(); //comparo jugadores Console.WriteLine("Comparo dos jugadores: "); Console.WriteLine(j1 == j2); Console.WriteLine(j1 != j2); Console.WriteLine(); //agrego jugador al equipo if (e1 + j1) { Console.WriteLine(j1.MostrarDatos()); } if (e1 + j2) { Console.WriteLine(j2.MostrarDatos()); } //aqui se excederia por la cantidad de jugadores maxima if (e1 + j3) { Console.WriteLine(j3.MostrarDatos()); } Console.ReadLine(); }
static void Main(string[] args) { Jugador jug1 = new Jugador(1234, "Leo", 25, 7); Jugador jug2 = new Jugador(2344, "Ailen"); Jugador jug3 = new Jugador(2344, "Jejeje"); Equipo equipo = new Equipo(3, "Los Kapos"); Equipo equipo2 = new Equipo(1, "Solitario"); if (equipo + jug1) { Console.WriteLine(jug1.MostrarDatos()); } if (equipo + jug2) { Console.WriteLine(jug2.MostrarDatos()); } if (equipo + jug3) { Console.WriteLine(jug3.MostrarDatos()); } if (equipo2 + jug1) { Console.WriteLine(jug1.MostrarDatos()); } if (equipo2 + jug2) { Console.WriteLine(jug2.MostrarDatos()); } Console.ReadKey(); }
static void Main(string[] args) { Equipo aldosivi = new Equipo(2, "Aldosivi"); Jugador mesi = new Jugador(123, "Lio", 2, 5); Jugador deMaria = new Jugador(333, "Fideo", 3, 8); Jugador iguain = new Jugador(444, "Pipa", -1, 7); Jugador dogbau = new Jugador(444, "Pepo", 158, 87); bool a; aldosivi += mesi; aldosivi += deMaria; aldosivi += iguain; aldosivi += dogbau; mesi.MostrarDatos(); deMaria.MostrarDatos(); iguain.MostrarDatos(); dogbau.MostrarDatos(); Console.ReadKey(); }
static void Main(string[] args) { Equipo equipoNuevo = new Equipo(11, "Club equipo"); Jugador jugadorUno = new Jugador(32346515, "Juan", 20, 10); Jugador jugadorDos = new Jugador(34351625, "Alberto", 10, 30); Console.WriteLine(jugadorUno.MostrarDatos()); if (equipoNuevo + jugadorUno) { Console.WriteLine("Se agrego jugador uno"); } else { Console.WriteLine("No se agrego jugador uno"); } if (equipoNuevo + jugadorDos) { Console.WriteLine("Se agrego jugador dos"); } else { Console.WriteLine("No se agrego jugador dos"); } if (equipoNuevo + jugadorUno) { Console.WriteLine("Se agrego jugador uno"); } else { Console.WriteLine("No se agrego jugador uno"); } Console.ReadKey(); }