65 lines
1.5 KiB
C#
65 lines
1.5 KiB
C#
namespace squadre_calcio;
|
|
|
|
class Giocatore {
|
|
string nome;
|
|
string cognome;
|
|
string eta;
|
|
string nomeRuolo;
|
|
string numeroMaglia;
|
|
|
|
public Giocatore(string p_nome, string p_cognome, string p_eta, string p_nomeRuolo, string p_numeroMaglia) {
|
|
this.nome = p_nome;
|
|
this.cognome = p_cognome;
|
|
this.eta = p_eta;
|
|
this.nomeRuolo = p_nomeRuolo;
|
|
this.numeroMaglia = p_numeroMaglia;
|
|
}
|
|
|
|
public string GetNome() {
|
|
return nome;
|
|
}
|
|
|
|
public string GetCognome() {
|
|
return cognome;
|
|
}
|
|
|
|
public string GetEta() {
|
|
return eta;
|
|
}
|
|
|
|
public string GetNomeRuolo() {
|
|
return nomeRuolo;
|
|
}
|
|
|
|
public string GetNumeroMaglia() {
|
|
return numeroMaglia;
|
|
}
|
|
|
|
public void SetNome(string p_nome) {
|
|
this.nome = p_nome;
|
|
}
|
|
|
|
public void SetCognome(string p_cognome) {
|
|
this.cognome = p_cognome;
|
|
}
|
|
|
|
public void SetEta(string p_eta) {
|
|
this.eta = p_eta;
|
|
}
|
|
|
|
public void SetNomeRuolo(string p_nomeRuolo) {
|
|
this.nomeRuolo = p_nomeRuolo;
|
|
}
|
|
|
|
public void SetNumeroMaglia(string p_numeroMaglia) {
|
|
this.numeroMaglia = p_numeroMaglia;
|
|
}
|
|
|
|
public void StampaGiocatore() {
|
|
Console.WriteLine($"Nome: {this.GetNome()}");
|
|
Console.WriteLine($"Cognome: {this.GetCognome()}");
|
|
Console.WriteLine($"Età: {this.GetEta()}");
|
|
Console.WriteLine($"Ruolo: {this.GetNomeRuolo()}");
|
|
Console.WriteLine($"Numero maglia: {this.GetNumeroMaglia()}");
|
|
}
|
|
} |