private int getTotalResourceProduction(Resource resource) {
int totalProduction = 0;
Iterator workforceIterator = getWorkForceManager().getWorkforce().entrySet().iterator();
while (workforceIterator.hasNext()) {
Entry entry = (Entry) workforceIterator.next();
WorkForce workForce = (WorkForce) entry.getValue();
Resource workForceResource = workForce.getResource();
if (resource.equals(workForceResource)) {
Coordinate coordinate = (Coordinate) entry.getKey();
Tile tile = getRealm().getTile(coordinate);
int producedQuantity = tile.getProduction(resource) * workForce.getNumberOfWorkers();
totalProduction = totalProduction + producedQuantity;
}
}
return totalProduction;
}