* Returns the total amount of engineers contained * in the base. * @return Number of engineers. */
| 509 | * @return Number of engineers. |
| 510 | */ |
| 511 | int Base::getTotalEngineers() const |
| 512 | { |
| 513 | int total = _engineers; |
| 514 | for (std::vector<Transfer*>::const_iterator i = _transfers.begin(); i != _transfers.end(); ++i) |
| 515 | { |
| 516 | if ((*i)->getType() == TRANSFER_ENGINEER) |
| 517 | { |
| 518 | total += (*i)->getQuantity(); |
| 519 | } |
| 520 | } |
| 521 | for (std::vector<Production *>::const_iterator iter = _productions.begin (); iter != _productions.end (); ++iter) |
| 522 | { |
| 523 | total += (*iter)->getAssignedEngineers(); |
| 524 | } |
| 525 | return total; |
| 526 | } |
| 527 | |
| 528 | /** |
| 529 | * Returns the amount of living quarters used up |
no test coverage detected