コード例 #1
0
  private boolean hasRequiredSkills(int skill, Player player) {
    String prereqs = skillPrereqs[skill];

    for (int i = 0; i < prereqs.length(); i++) {
      int prereqIndex = prereqs.charAt(i) - 65;
      if (!player.hasSkill(prereqIndex)) return false;
    }

    return true;
  }
コード例 #2
0
  public boolean isButtonEnabled(int skill, Player player) {
    if (player == null) return false;

    if (player.hasSkill(skill)) return false;

    if (player.getSkillPoints() < getSkillXpCost(skill, player)) return false;

    if (!hasRequiredSkills(skill, player)) return false;

    return true;
  }
コード例 #3
0
 public boolean isButtonSelected(int skill, Player player) {
   return (player != null && player.hasSkill(skill));
 }