Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace fantacalcio
- {
- class Mercato
- {
- List<Giocatore> giocatori;
- public Mercato()
- {
- giocatori = new List<Giocatore>();
- }
- public void Newslegato()
- {
- Console.WriteLine("inserisci il nome, il cognome, il ruolo, il prezzo e il codice del nuovo giocatore\n");
- giocatori.Add(new Giocatore(Console.ReadLine(), Console.ReadLine(), Console.ReadLine(), Convert.ToInt32(Console.ReadLine()), Convert.ToInt32(Console.ReadLine())));
- }
- public void StampaMerc()
- {
- foreach (Giocatore g in giocatori)
- Console.WriteLine(g);
- }
- public Giocatore Ricerca()
- {
- string s;
- Giocatore gio;
- Console.WriteLine("inserisci il cognome del giocatore che vuoi comprare ");
- s = Console.ReadLine();
- gio = giocatori.Find(x => x.Cognome.Equals(s));
- return gio;
- }
- public void Rimuovi(Giocatore g)
- {
- giocatori.Remove(g);
- }
- public void AddMercato(Giocatore g)
- {
- giocatori.Add(g);
- }
- }
- }
Add Comment
Please, Sign In to add comment