* Returns the total amount of craft of * a certain type stored in the base. * @param craft Craft type. * @return Number of craft. */
| 885 | * @return Number of craft. |
| 886 | */ |
| 887 | int Base::getCraftCount(const std::string &craft) const |
| 888 | { |
| 889 | int total = 0; |
| 890 | for (std::vector<Craft*>::const_iterator i = _crafts.begin(); i != _crafts.end(); ++i) |
| 891 | { |
| 892 | if ((*i)->getRules()->getType() == craft) |
| 893 | { |
| 894 | total++; |
| 895 | } |
| 896 | } |
| 897 | return total; |
| 898 | } |
| 899 | |
| 900 | /** |
| 901 | * Returns the total amount of monthly costs |
no test coverage detected