-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTeam.java
More file actions
68 lines (55 loc) · 1.34 KB
/
Team.java
File metadata and controls
68 lines (55 loc) · 1.34 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
import java.util.List;
public class Team
{
public String city;
public String team;
public String abrv;
public double payroll;
public double fg;
public double fga;
public double fg_p;
public double three_fg;
public double three_fga;
public double three_fg_p;
public List<Player> players;
public Team(String city, String team, String abrv,
double fg, double fga, double fg_p,
double three_fg, double three_fg_a, double three_fg_p, List players)
{
this.city = city;
this.team = team;
this.abrv = abrv;
this.fg = fg;
this.fga = fga;
this.fg_p = fg_p;
this.three_fg = three_fg;
this.three_fga = three_fg_a;
this.three_fg_p = three_fg_p;
this.players = players;
this.payroll_init();
}
public Player get_player(String player_name)
{
for (Player p: players)
{
if (player_name.equals(p.last))
{
return p;
}
}
return null;
}
public String get_full_name()
{
return this.city + ' ' + this.team;
}
private void payroll_init()
{
double sal = 0;
for (Player p: this.players)
{
sal += p.sal_2015;
}
this.payroll = sal;
}
}