* Returns the amount of weapons currently * equipped on this craft. * @return Number of weapons. */
| 394 | * @return Number of weapons. |
| 395 | */ |
| 396 | int Craft::getNumWeapons() const |
| 397 | { |
| 398 | if (_rules->getWeapons() == 0) |
| 399 | { |
| 400 | return 0; |
| 401 | } |
| 402 | |
| 403 | int total = 0; |
| 404 | |
| 405 | for (std::vector<CraftWeapon*>::const_iterator i = _weapons.begin(); i != _weapons.end(); ++i) |
| 406 | { |
| 407 | if ((*i) != 0) |
| 408 | { |
| 409 | total++; |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | return total; |
| 414 | } |
| 415 | |
| 416 | /** |
| 417 | * Returns the amount of soldiers from a list |
no test coverage detected