-
Notifications
You must be signed in to change notification settings - Fork 0
/
LeagueManager.java
69 lines (55 loc) · 2.23 KB
/
LeagueManager.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
65
66
67
68
69
import com.teamtreehouse.model.Player;
import com.teamtreehouse.model.Players;
import com.teamtreehouse.UI;
import com.teamtreehouse.model.Teams;
import com.teamtreehouse.model.Team;
import java.util.Set;
import java.util.TreeSet;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.HashMap;
import java.util.Arrays;
public class LeagueManager {
//public static Teams teams = new Teams();
public static Players mPlayers = new Players();
public static Set<Player> availablePlayers = new TreeSet<Player>();
public static Set<Team> mTeams = new TreeSet<Team>();
public static void main(String[] args) {
Player[] players = Players.load();
System.out.printf("%nThere are currently %d registered players.%n%n", players.length);
// Your code here!
availablePlayers.addAll(Arrays.asList(players));
// **** PRINT AVAILABLE PLAYERS CODE ****
/*System.out.println("All available players:");
for (Player player : availablePlayers) {
System.out.printf("%s %s %s %s %n",
player.getFirstName(),
player.getLastName(),
player.getHeightInInches(),
player.isPreviousExperience());
}*/
// ************
//mPlayers.addPlayersToSet(Players.load());
//mPlayers.addPlayersToMap(Players.load());
//System.out.printf("%nSet size is: %d %n", mPlayers.playersSet.size());
/*for (Player player : mPlayers.playersSet) {
System.out.printf("%s%n", player.getFirstName());
}
for(Map.Entry<String, Player> entry : mPlayers.playersMap.entrySet()) {
//System.out.println(Integer.toString(entry.getKey())); for debug loop
String key = entry.getKey();
Player player = entry.getValue();
System.out.printf("key: %s, lastname: %s, firstname: %s%n",
key,
player.getFirstName(),
player.getLastName());
}*/
/*for (Iterator<Player> iterator = mPlayers.playersSet.iterator(); iterator.hasNext();) {
Player o = iterator.next();
System.out.printf("%s ", o.getFirstName());
}*/
UI ui = new UI(mTeams, availablePlayers);
ui.run();
}
}