Exemplo n.º 1
0
 /**
  * Changes a specified player's score by the specified amount.
  *
  * @param player The player
  * @param deltaScore The amount their score should change
  */
 public void updatePlayerScore(String player, int deltaScore) {
   if (!scores.containsKey(player)) {
     Logger.log("Couldn't update player: " + player + " because they aren't in the scoreboard.");
   } else {
     scores.put(player, scores.get(player) + deltaScore);
   }
 }
Exemplo n.º 2
0
 /**
  * Adds a player to the scoreboard if they aren't already on it.
  *
  * @param player
  */
 public void addPlayer(String player) {
   if (!scores.containsKey(player)) {
     Logger.log("Haven't seen " + player + " before. Adding " + player + " to highscores.");
     scores.put(player, 0);
   }
 }