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 Squadra
- {
- public string Nome { get; set; }
- public int Budget { get; set; }
- List<Giocatore> professionisti;
- public Squadra()
- {
- professionisti = new List<Giocatore>();
- }
- public void Newsquadra()
- {
- Console.WriteLine("Inserisci il nome della tua squadra ");
- Nome = Console.ReadLine();
- Console.Clear();
- Console.WriteLine("Inserisci il budget ");
- Budget = Convert.ToInt32(Console.ReadLine());
- }
- public void CompraG(Giocatore g)
- {
- professionisti.Add(g);
- }
- public Giocatore RicercaS()
- {
- string s;
- Giocatore g;
- Console.WriteLine("inserisci il cognome del giocatore che vuoi comprare ");
- s = Console.ReadLine();
- g = professionisti.Find(x => x.Cognome.Equals(s));
- return g;
- }
- public void MostraS()
- {
- Console.WriteLine("Hai chiamato la tua squadra {0} e il tuo budget e' {1}", Nome, Budget);
- }
- public void Mostra()
- {
- Console.WriteLine("SQUADRA: {0} BUDGET: {1}", Nome, Budget);
- }
- public void Stampa()
- {
- foreach(Giocatore g in professionisti)
- Console.WriteLine(g);
- }
- public void RimuoviS(Giocatore g)
- {
- professionisti.Remove(g);
- }
- }
- }
Add Comment
Please, Sign In to add comment