Examples of EmptyPlayerNameException


Examples of oop13.space.exceptions.EmptyPlayerNameException

  @Override
  public void submitScore() throws EmptyPlayerNameException {
    Integer score = this.model.getStatistics().getScore();
    String name = this.subScore.getTextField().getText();
    if (name.trim().isEmpty()) {
      throw new EmptyPlayerNameException();
    }
    if (name.length() >= MAX_NAME_LENGTH) {
      name = name.substring(0, MAX_NAME_LENGTH);
    }
    HighScore.getHighScore().addScore(name, score);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.