return tileImprovementType;
}
public void setPrerequisitesFromNode(TileImprovementTypeManager tileImprovementManager, Node node) {
int id = Integer.parseInt(XMLConverterUtility.findNode(node, "id").getFirstChild().getNodeValue());
TileImprovementType tileImprovement = tileImprovementManager.getImprovement(id);
for (Node subNode = node.getFirstChild(); subNode != null; subNode = subNode.getNextSibling()) {
if (subNode.getNodeType() == Node.ELEMENT_NODE) {
if (subNode.getNodeName().equals("prerequisites")) {
for (Node prerequisiteNode = subNode.getFirstChild(); prerequisiteNode != null; prerequisiteNode = prerequisiteNode.getNextSibling()) {
if (prerequisiteNode.getNodeType() == Node.ELEMENT_NODE) {
if (prerequisiteNode.getNodeName().equals("NoVegetation")) {
NoVegetationPrerequisite noVegetationPrerequisite = new NoVegetationPrerequisite();
tileImprovement.addPrerequisite(noVegetationPrerequisite);
} else if (prerequisiteNode.getNodeName().equals("NoTileImprovement")) {
NoTileImprovementPrerequisite noTileImprovementPrerequisite = new NoTileImprovementPrerequisite();
for (Node prerequisiteSubNode = prerequisiteNode.getFirstChild(); prerequisiteSubNode != null; prerequisiteSubNode = prerequisiteSubNode.getNextSibling()) {
if (prerequisiteSubNode.getNodeType() == Node.ELEMENT_NODE) {
int prerequisiteSubNodeId = Integer.parseInt(prerequisiteSubNode.getAttributes().getNamedItem("id").getNodeValue());
noTileImprovementPrerequisite.addExclusiveImprovementId(prerequisiteSubNodeId);
}
}
tileImprovement.addPrerequisite(noTileImprovementPrerequisite);
}
}
}
}
}