-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGiocatore.java
74 lines (56 loc) · 1.52 KB
/
Giocatore.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* Classe giocatore.
* In questa classe vengono specificati i vari metodi per l'oggetto giocatore.
*/
/**
* Classe dell'oggetto giocatore.
* @author Ferrari Vincenzo e Iadarola Barbara.
*/
public class Giocatore
{
/**
* Costruttore per un giocatore
*/
public Giocatore(){
this("nome","cognome",0);
}
/**
* Costruttore per un nuovo giocatore
* @param nomeGiocatore : nome del giocatore
* @param cognomeGiocatore : cognome del giocatore
* @param punteggioGiocatore : punteggio del giocatore
*/
public Giocatore(String nomeGiocatore, String cognomeGiocatore, int punteggioGiocatore)
{
nome=nomeGiocatore;
cognome=cognomeGiocatore;
punteggio=punteggioGiocatore;
}
/**
* Metodo che ritorna il nome del giocatore
* @return : il nome del giocatore
*/
public String getNome( )
{
return nome;
}
/**
* Metodo che ritorna il cognome del giocatore
* @return : il cognome del giocatore
*/
public String getCognome( )
{
return cognome;
}
/**
* Metodo che ritorna il punteggio del giocatore
* @return : il punteggio del giocatore
*/
public int getPunteggio()
{
return punteggio;
}
protected String nome; // nome del giocatore
protected String cognome; // cognome del giocatore
protected int punteggio; // punteggio del giocatore
}