예제 #1
0
  private boolean findCharacter(String characterNameInput) {
    int characterListSize = getCharacterList() == null ? 0 : getCharacterList().size();

    if (getCharacterList() != null && characterListSize > 0) {
      for (Character character : getCharacterList()) {
        String characterName = character.getCharacterName();

        boolean isCharacterNameMatched = characterNameInput.equals(characterName);
        if (isCharacterNameMatched) {
          return true;
        }
      }
    }
    return false;
  }
예제 #2
0
  private void createCharacter(Character newCharacter) {

    Button btn =
        createCharacterBtn(
            getRandomAvatarPath(), Constants.AVATAR_IMAGE_WIDTH, Constants.AVATAR_IMAGE_HEIGHT);
    btn.setText(
        String.format(
            "%s\nLevel: %s\nClass: %s \nRace: %s",
            newCharacter.getCharacterName(),
            newCharacter.getCharacterLevel(),
            newCharacter.getCharacterClass(),
            newCharacter.getCharacterRace()));

    characterList.getChildren().add(0, btn);
  }