-
Notifications
You must be signed in to change notification settings - Fork 0
/
JJNB_Awper.java
58 lines (49 loc) · 1.3 KB
/
JJNB_Awper.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_Awper extends JJNB_Player{
private double openPicks;
public JJNB_Awper() {// default
super();
openPicks = 0;
}
public JJNB_Awper(double op) { //non-default
super();
openPicks = op;
}
public JJNB_Awper(String name, double kd, int winnings, double rating, double op, JJNB_Team nTeam) { //second non-default
super(name, kd, winnings, rating, nTeam); //puts nondefault instances of the parent variables
openPicks = op;
}
//gets and sets methods
public double getRoleStat () {
return openPicks;
}
public void setRoleStat (double setPick) {
openPicks = setPick;
}
public String toString () {
String line = super.toString() + " Opening pick rate: " + openPicks; //overrides the parent's toString
return line;
}
public boolean equals (JJNB_Awper awp) {
boolean check = false;
if (Math.abs(openPicks - awp.getRoleStat()) < .001 && super.equals((JJNB_Player) awp)) { //makes sure it's the same awper
check = true;
}
else {
check = false;
}
return check;
}
public int comparePicks (JJNB_Awper awp) {
int check = -1;
if (openPicks - awp.getRoleStat() > 0) {
check = 1;
}
else if (openPicks == awp.getRoleStat()) {
check = 0;
}
else {
check = -1;
}
return check;
}
}