Example #1
0
  public void createDependencies(Element dep, Quest quest) {
    if (dep != null) {

      // if there are quests
      if (dep.getChild("Quest") != null) {
        // get the quest dependencies
        quest.setQuestDependencies(loadOneDependencie(dep.getChild("Quest")));
      }

      // if there are itens needed
      if (dep.getChild("Itens") != null) {
        // get the Itens
        Object[] objects;
        objects = loadTwoDependencies(dep.getChild("Itens"));
        // set their places
        quest.setItemDependencies((String[]) objects[0]);
        quest.setItemDependenciesQuantity((int[]) objects[1]);
      }

      // if exists the need for levels
      if (dep.getChild("Level") != null) {
        // get the Level
        quest.setLevelDependencie(Integer.parseInt(dep.getChildText("Level")));
      }
    }
  }