-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.java
80 lines (78 loc) · 1.89 KB
/
Player.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
75
76
77
78
79
80
/**
*
* @author JWKoziel
*
* This is player class object which get created whenever I populate the database.
*
*/
public class Player {
//Unique id.
protected int id;
//Name and surname.
protected String name;
//Their contact information.
protected int phoneNumber;
//Change to data type.
protected String dateJoined;
//Player wins .
protected int wins;
//Player losses.
protected int loses;
//Average score manually set.
protected int averageScore;
//Constructor creates new object with full set of its variables.
public Player(int id, String name, int phoneNumber, String dateJoined, int wins, int loses, int averageScore) {
super();
//Give local variables the value of variables sent through when objects were initialised.
this.id = id;
this.name = name;
this.phoneNumber = phoneNumber;
this.dateJoined = dateJoined;
this.wins = wins;
this.loses = loses;
this.averageScore = averageScore;
}
//Getters and setters for the player class object.
protected int getId() {
return id;
}
protected void setId(int id) {
this.id = id;
}
protected String getName() {
return name;
}
protected void setName(String name) {
this.name = name;
}
protected int getPhoneNumber() {
return phoneNumber;
}
protected void setPhoneNumber(int phoneNumber) {
this.phoneNumber = phoneNumber;
}
protected String getDateJoined() {
return dateJoined;
}
protected void setDateJoined(String dateJoined) {
this.dateJoined = dateJoined;
}
protected int getWins() {
return wins;
}
protected void setWins(int wins) {
this.wins = wins;
}
protected int getLoses() {
return loses;
}
protected void setLoses(int loses) {
this.loses = loses;
}
protected int getAverageScore() {
return averageScore;
}
protected void setAverageScore(int averageScore) {
this.averageScore = averageScore;
}
}