CraftScoreboard(Scoreboard board) { this.board = board; for (ScoreboardObjective objective : (Iterable<ScoreboardObjective>) board.getObjectives()) { new CraftObjective(this, objective); // It adds itself to map } for (ScoreboardTeam team : (Iterable<ScoreboardTeam>) board.getTeams()) { new CraftTeam(this, team); // It adds itself to map } }
public ImmutableSet<Team> getTeams() { return ImmutableSet.copyOf(Iterables.transform((Collection<ScoreboardTeam>) this.board.getTeams(), new Function<ScoreboardTeam, Team>() { @Override public Team apply(ScoreboardTeam input) { return new CraftTeam(CraftScoreboard.this, input); } })); }
public Team getPlayerTeam(OfflinePlayer player) throws IllegalArgumentException { Validate.notNull(player, "OfflinePlayer cannot be null"); ScoreboardTeam team = board.getPlayerTeam(player.getName()); return team == null ? null : teams.get(team.getName()); }
CraftTeam(CraftScoreboard scoreboard, ScoreboardTeam team) { super(scoreboard); this.team = team; scoreboard.teams.put(team.getName(), this); }
public Team getPlayerTeam(OfflinePlayer player) throws IllegalArgumentException { Validate.notNull(player, "OfflinePlayer cannot be null"); ScoreboardTeam team = board.getPlayerTeam(player.getName()); return team == null ? null : new CraftTeam(this, team); }
public Team getEntryTeam(String entry) throws IllegalArgumentException { Validate.notNull(entry, "Entry cannot be null"); ScoreboardTeam team = board.getPlayerTeam(entry); return team == null ? null : new CraftTeam(this, team); }
public Team getTeam(String teamName) throws IllegalArgumentException { Validate.notNull(teamName, "Team name cannot be null"); ScoreboardTeam team = board.getTeam(teamName); return team == null ? null : new CraftTeam(this, team); }
CraftTeam(CraftScoreboard scoreboard, ScoreboardTeam team) { super(scoreboard); this.team = team; }