* Returns the total amount of vehicles of * a certain type stored in the craft. * @param vehicle Vehicle type. * @return Number of vehicles. */
| 853 | * @return Number of vehicles. |
| 854 | */ |
| 855 | int Craft::getVehicleCount(const std::string &vehicle) const |
| 856 | { |
| 857 | int total = 0; |
| 858 | for (std::vector<Vehicle*>::const_iterator i = _vehicles.begin(); i != _vehicles.end(); ++i) |
| 859 | { |
| 860 | if ((*i)->getRules()->getType() == vehicle) |
| 861 | { |
| 862 | total++; |
| 863 | } |
| 864 | } |
| 865 | return total; |
| 866 | } |
| 867 | |
| 868 | /** |
| 869 | * Returns the craft's dogfight status. |
no test coverage detected