-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJJNB_InGameLeader.java
58 lines (49 loc) · 1.37 KB
/
JJNB_InGameLeader.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
public class JJNB_InGameLeader extends JJNB_Player{
private double clutches;
public JJNB_InGameLeader() { //default
super();
clutches = 0;
}
public JJNB_InGameLeader(double nclutch) { //non-default
super();
clutches = nclutch;
}
public JJNB_InGameLeader(String name, double kd, int winnings, double rating, double nclutch, JJNB_Team nteam) { //second non-default
super(name, kd, winnings, rating, nteam); //puts nondefault instances of the parent variables
clutches = nclutch;
}
//accesor and mutator methods
public double getRoleStat () {
return clutches;
}
public void setRoleStat (double setClu) {
clutches = setClu;
}
public String toString () {
String line = super.toString() + " Number of clutches made: " + clutches; //overrides the parent's toString method
return line;
}
public boolean equals (JJNB_InGameLeader igl) {
boolean check = false;
if (super.equals((JJNB_Player)igl) && Math.abs(clutches - igl.getRoleStat()) < .01) { //makes sure it's the correct igl
check = true;
}
else {
check = false;
}
return check;
}
public int compareClutches (JJNB_InGameLeader igl) {
int check = -1;
if (clutches - igl.getRoleStat() > 0) {
check = 1;
}
else if (clutches == igl.getRoleStat()) {
check = 0;
}
else {
check = -1;
}
return check;
}
}