* Returns the total amount of scientists contained * in the base. * @return Number of scientists. */
| 474 | * @return Number of scientists. |
| 475 | */ |
| 476 | int Base::getTotalScientists() const |
| 477 | { |
| 478 | int total = _scientists; |
| 479 | for (std::vector<Transfer*>::const_iterator i = _transfers.begin(); i != _transfers.end(); ++i) |
| 480 | { |
| 481 | if ((*i)->getType() == TRANSFER_SCIENTIST) |
| 482 | { |
| 483 | total += (*i)->getQuantity(); |
| 484 | } |
| 485 | } |
| 486 | const std::vector<ResearchProject *> & research (getResearch()); |
| 487 | for (std::vector<ResearchProject *>::const_iterator itResearch = research.begin (); |
| 488 | itResearch != research.end (); |
| 489 | ++itResearch) |
| 490 | { |
| 491 | total += (*itResearch)->getAssigned (); |
| 492 | } |
| 493 | return total; |
| 494 | } |
| 495 | |
| 496 | /** |
| 497 | * Returns the amount of engineers contained |
no test coverage detected