-
Notifications
You must be signed in to change notification settings - Fork 0
/
Team.java
64 lines (52 loc) · 2.06 KB
/
Team.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
59
60
61
62
63
64
public class Team {
public Team(QuarterBack qb, RunningBack rb1, RunningBack rb2, WideReceiver wr1, WideReceiver wr2, WideReceiver wr3,
Player flex, TightEnd te, Defense d) {
}
//initialize team
public Player[] team = new Player[9];
//initialize team rating
public double teamRating;
//initialize team value
public int teamValue;
//initialize positions
public QuarterBack quarterBack;
public RunningBack runningBack1;
public RunningBack runningBack2;
public WideReceiver wideReceiver1;
public WideReceiver wideReceiver2;
public WideReceiver wideReceiver3;
public TightEnd tightEnd;
public Player flex;
public Defense defense;
public Player selectPlayer(Player[] playerArray){
//algorithm analysis
//set selected player
Player selectedPlayer = null;
return selectedPlayer;
}
public Player selectFlex(Player[] rbArray, Player[] wrArray, Player[] teArray){
//select player with highest rating/value ratio
//set selected player
Player selectedFlex = null;
return selectedFlex;
}
public Defense selectDefense(Defense[] defenses){
//algorithm analysis
Defense selectedDefense = null;
return selectedDefense;
}
public Team generateTeam(QuarterBack qb, RunningBack rb1, RunningBack rb2, WideReceiver wr1, WideReceiver wr2, WideReceiver wr3, Player flex, TightEnd te, Defense d){
//we use the selectPlayer algorithm to select players from an array of available players
qb = (QuarterBack) selectPlayer(QuarterBack.quarterBacks);
rb1 = (RunningBack) selectPlayer(RunningBack.runningBacks);
rb2 = (RunningBack) selectPlayer(RunningBack.runningBacks);
wr1 = (WideReceiver) selectPlayer(WideReceiver.wideReceivers);
wr2 = (WideReceiver) selectPlayer(WideReceiver.wideReceivers);
wr3 = (WideReceiver) selectPlayer(WideReceiver.wideReceivers);
flex = selectFlex(RunningBack.runningBacks, WideReceiver.wideReceivers, TightEnd.tightEnds);
te = (TightEnd) selectPlayer(TightEnd.tightEnds);
d = selectDefense(Defense.defenses);
Team generatedTeam = new Team(qb, rb1, rb2, wr1, wr2, wr3, flex, te, d);
return generatedTeam;
}
}