// Constructions in progress
List<BuildingAction> actions = GameData.getSelectedColony()
.getBuildingActions();
for (BuildingAction action : actions) {
Building b = action.getBuilding();
Image gfx = null;
if (BuildingType.ROAD.equals(b.getType())) {
// Road are rendered according to the neighbors buildings
gfx = UIHelper.getRoadGfx(b);
} else {
gfx = ImageManager.getGfx(b.getType().toString());
}
gfx.draw(getScreenX(b.getX()), getScreenY(b.getY()), new Color(
0.5F, 0.5F, 0.5F, 0.5F));
// Render the construction progress bar
int progress = action.getProgression();
int x = getScreenX(b.getX());
int y = getScreenY(b.getY());
int width = NumberHelper.ruleOf3(100, Settings.TILE_SIZE, progress);
if (action.isUpgrade()) {
// Update : yellow
g.setColor(Color.magenta);
} else {
// Creation : red
g.setColor(Color.red);
}
g.drawLine(x, y, x + width, y);
g.drawLine(x, y + 1, x + width, y + 1);
g.drawLine(x, y + 2, x + width, y + 2);
if (b.equals(this.selectedBuilding)) {
highlightBuilding(g, b);
}
}
// Robots