-
Notifications
You must be signed in to change notification settings - Fork 2
/
Player.pde
57 lines (46 loc) · 1.25 KB
/
Player.pde
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
public class Player {
private final static String playerPrefix = "images/players/";
private final static String playerSufix = ".png";
private int id;
private int teamId;
private String firstName;
private String lastName;
private int jerseyNumber;
private String position;
private PImage photo;
public Player(int id, int teamId, String firstName, String lastName,
int jerseyNumber, String position) {
this.id = id;
this.teamId = teamId;
this.firstName = firstName;
this.lastName = lastName;
this.jerseyNumber = jerseyNumber;
this.position = position;
this.photo = loadImage(playerPrefix + this.id + playerSufix);
this.photo.resize(186, 150);
}
public int getId() {
return this.id;
}
public String getFullName() {
return this.firstName + " " + this.lastName;
}
public String getQuoteName() {
return this.lastName + ", " + this.firstName;
}
public String getLastName() {
return this.lastName;
}
public int getJerseyNumber() {
return this.jerseyNumber;
}
public String getPosition() {
return this.position;
}
public PImage getPhoto() {
return this.photo;
}
public Team getTeam() {
return TEAMS.get(this.teamId);
}
}