* Returns the amount of soldiers from a list * that are currently attached to this craft. * @return Number of soldiers. */
| 419 | * @return Number of soldiers. |
| 420 | */ |
| 421 | int Craft::getNumSoldiers() const |
| 422 | { |
| 423 | if (_rules->getSoldiers() == 0) |
| 424 | return 0; |
| 425 | |
| 426 | int total = 0; |
| 427 | |
| 428 | for (std::vector<Soldier*>::iterator i = _base->getSoldiers()->begin(); i != _base->getSoldiers()->end(); ++i) |
| 429 | { |
| 430 | if ((*i)->getCraft() == this) |
| 431 | total++; |
| 432 | } |
| 433 | |
| 434 | return total; |
| 435 | } |
| 436 | |
| 437 | /** |
| 438 | * Returns the amount of equipment currently |
no test coverage detected