-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScore.java
More file actions
42 lines (35 loc) · 890 Bytes
/
Score.java
File metadata and controls
42 lines (35 loc) · 890 Bytes
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
import java.io.Serializable;
/**
* Score Class - responsible for storing the username and its score
* implements Serializable
* @author Samu
*
*/
public class Score implements Serializable {
private static final long serialVersionUID = 1L; // default serial version ID
private int score;
private String userName;
/**
* Method used to obtain score value
* @return score
*/
public int getScore() {
return score;
}
/**
* Method used to obtain username
* @return userName
*/
public String getUserName() {
return userName;
}
/**
* Constructor that assigns received values to Score class
* @param userName
* @param score
*/
public Score(String userName, int score) {
this.score = score;
this.userName = userName;
}
}