final String northId = element.attributeValue("north");
final String eastId = element.attributeValue("east");
final String southId = element.attributeValue("south");
final String westId = element.attributeValue("west");
final Sector sector;
final List<?> switches = element.elements("switch");
if (switches.size() == 0)
{
final boolean shipyard = hasShipyard(element);
final Asteroid[] asteroids = getAsteroids(element);
sector =
new Sector(this.game, id, x, y, race, planets, suns,
core, shipyard, northId, eastId, southId, westId,
asteroids);
}
else
{
final Asteroid[][] asteroidsList =
new Asteroid[switches.size()][];
int i = 0;
for (final Object switchItem : switches)
{
final Element switchElement = (Element) switchItem;
asteroidsList[i] = getAsteroids(switchElement);
i++;
}
sector =
new PlayerSector(this.game, id, x, y, race, planets,
suns, core, northId, eastId, southId, westId,
asteroidsList);
}
this.sectors.add(sector);
this.sectorMap.put(id, sector);
this.maxSiliconYield = Math.max(this.maxSiliconYield, sector
.getTotalSiliconYield());
this.maxOreYield = Math.max(this.maxOreYield, sector
.getTotalOreYield());
this.maxNividiumYield = Math.max(this.maxNividiumYield, sector
.getTotalNividiumYield());
this.maxIceYield = Math.max(this.maxIceYield, sector
.getTotalIceYield());
}
}
catch (final DocumentException e)
{