Пример #1
0
 /**
  * Spieler Daten Updaten
  *
  * @param id
  * @param wins
  * @param loss
  * @return
  */
 public Player updatePlayer(int id, int wins, int loss, Player player) {
   if (player.getId() == id) {
     player.setWins(wins);
     player.setLoss(loss);
   } else {
     System.out.println("Gesuchte id " + id + " gibt es nicht.");
   }
   return player;
 }
Пример #2
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.");
   }
 }
Пример #3
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;
 }