}
else if("shape".equalsIgnoreCase(e.getNodeName()) || "restart_point".equalsIgnoreCase(e.getNodeName()) || "PKrestart_point".equalsIgnoreCase(e.getNodeName()))
{
int locId = IdFactory.getInstance().getNextId();
boolean isRound = !XMLUtil.getAttributeValue(e, "loc").isEmpty();
L2Territory territory;
if(isRound)
{
String[] coord = XMLUtil.getAttributeValue(e, "loc").replaceAll(",", " ").replaceAll(";", " ").replaceAll(" ", " ").trim().split(" ");
if(coord.length < 5) // Не указаны minZ и maxZ, берем граничные значения
{
territory = new L2RoundTerritory(locId, Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.MIN_VALUE, Integer.MAX_VALUE);
}
else
{
territory = new L2RoundTerritory(locId, Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.parseInt(coord[3]), Integer.parseInt(coord[4]));
}
}
else
{
territory = new L2Territory(locId);
for(Node location = e.getFirstChild(); location != null; location = location.getNextSibling())
{
if("coords".equalsIgnoreCase(location.getNodeName()))
{
String[] coord = XMLUtil.getAttributeValue(location, "loc").replaceAll(",", " ").replaceAll(";", " ").replaceAll(" ", " ").trim().split(" ");
if(coord.length < 4) // Не указаны minZ и maxZ, берем граничные значения
{
territory.add(Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.MIN_VALUE, Integer.MAX_VALUE);
}
else
{
territory.add(Integer.parseInt(coord[0]), Integer.parseInt(coord[1]), Integer.parseInt(coord[2]), Integer.parseInt(coord[3]));
}
}
}
}
if("shape".equalsIgnoreCase(e.getNodeName()))
{
z.setLoc(territory);
territory.setZone(z);
territory.validate();
}
else if("restart_point".equalsIgnoreCase(e.getNodeName()))
{
z.setRestartPoints(territory);
}