-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeek.java
More file actions
157 lines (140 loc) · 3.29 KB
/
Week.java
File metadata and controls
157 lines (140 loc) · 3.29 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/**
* The team class oversees the Week object, which is how the results of each week are entered and connected to a team.
* It tracks stats, opponents and wins
* @author oscarfilson
*/
public class Week {
private int wins;
private int goals;
private int assists;
private int saves;
private int shots;
private int goalsAgainst;
/**
* Makes a new Week object - with just wins so far added
* @param int wins - the wins they got in that week.
*/
public Week(int wins) {
this.wins = wins;
this.goals = 0;
this.assists = 0;
this.saves = 0;
this.shots = 0;
this.goalsAgainst = 0;
}
/**
* Makes a new Week object - with all the stats added
* @param int wins - the wins they got in that week.
* @param int goals- the goals they got in that week
* @param int assists- the assists they got in that week
* @param int saves- the saves they got in that week
* @param int shots- the shots they got in that week
* @param int goalsAgainst- the goalsAgainst they got in that week
*/
public Week(int wins, int goals, int assists, int saves, int shots, int goalsAgainst) {
this.wins = wins;
this.goals = goals;
this.assists = assists;
this.saves = saves;
this.shots = shots;
this.goalsAgainst = goalsAgainst;
}
/**
* Returns the wins of that week
* @return int wins
*/
public int getWins() {
return wins;
}
/**
* Sets the wins they got in the week
* @param int wins - the amount of wins
*/
public void setWins(int wins) {
this.wins = wins;
}
/**
* Returns the goals of that week
* @return int goals
*/
public int getGoals() {
return goals;
}
/**
* Sets the goals they got in the week
* @param int goals - the amount of goals
*/
public void setGoals(int goals) {
this.goals = goals;
}
/**
* Returns the assists of that week
* @return int assists
*/
public int getAssists() {
return assists;
}
/**
* Sets the assists they got in the week
* @param int assists - the amount of assists
*/
public void setAssists(int assists) {
this.assists = assists;
}
/**
* Returns the saves of that week
* @return int saves
*/
public int getSaves() {
return saves;
}
/**
* Sets the saves they got in the week
* @param int saves - the amount of saves
*/
public void setSaves(int saves) {
this.saves = saves;
}
/**
* Returns the shots of that week
* @return int shots
*/
public int getShots() {
return shots;
}
/**
* Sets the shots they got in the week
* @param int shots - the amount of shots
*/
public void setShots(int shots) {
this.shots = shots;
}
/**
* Returns the goals against of that week
* @return int goalsAgainst
*/
public int getGoalsAgainst() {
return goalsAgainst;
}
/**
* Sets the goals against they got in the week
* @param int goalsAgaisnt - the amount of goalsAgainst
*/
public void setGoalsAgainst(int goalsAgainst) {
this.goalsAgainst = goalsAgainst;
}
/**
* Formats the information of any given week
* @return String output - formatted info
*/
public String toString() {
String output = "";
output += "Wins :: " + wins;
output += ", Goals :: " + goals;
output += ", Assists :: " + assists;
output += ", Saves :: " + saves;
output += ", Shots :: " + shots;
output += ", Goals Against :: " + goalsAgainst + ".";
return output;
}
}