use of delta.games.lotro.lore.quests.io.xml.QuestXMLParser in project lotro-tools by dmorcellet.
the class QuestsIndexBuilder method doIt.
/**
* Do build quests index.
* @return <code>true</code> if it was done, <code>false</code> otherwise.
*/
public boolean doIt() {
boolean ret = false;
if (_questsDir.exists()) {
QuestsIndex index = new QuestsIndex();
ExtensionPredicate extFilter = new ExtensionPredicate(".xml");
File[] questFiles = _questsDir.listFiles(extFilter);
if (questFiles != null) {
QuestXMLParser parser = new QuestXMLParser();
for (File questFile : questFiles) {
QuestDescription q = parser.parseXML(questFile);
String category = q.getCategory();
String key = q.getKey();
String title = q.getTitle();
int id = q.getIdentifier();
index.addQuest(category, id, key, title);
}
QuestsIndexWriter writer = new QuestsIndexWriter();
ret = writer.write(_indexFile, index, EncodingNames.UTF_8);
}
}
return ret;
}
Aggregations