示例#1
0
 /**
  * Daten von Spieler löschen
  *
  * @param id
  * @return Player
  */
 public void deletePlayer(int id, Player player) {
   if (player.getId() == id) {
     player.setName(null);
     player.setId(0);
     player.setWins(0);
     player.setLoss(0);
   } else {
     System.out.println("Gesuchte id " + id + " gibt es nicht.");
   }
 }
示例#2
0
 /**
  * @param name
  * @param id
  * @param wins
  * @param loss
  * @return Player
  */
 public Player createPlayer(String name, int id, int wins, int loss) {
   Player player = new Player();
   if (player.getId() != id) {
     player.setName(name);
     player.setId(id);
     player.setWins(wins);
     player.setLoss(loss);
   } else {
     System.out.println("Gesuchte id " + id + " gibt es schon.");
   }
   return player;
 }