* Adds the given number of scientists to the project if possible. * @param change Number of scientists to add. */
| 306 | * @param change Number of scientists to add. |
| 307 | */ |
| 308 | void ResearchInfoState::moreByValue(int change) |
| 309 | { |
| 310 | if (0 >= change) return; |
| 311 | int freeScientist = _base->getAvailableScientists(); |
| 312 | int freeSpaceLab = _base->getFreeLaboratories(); |
| 313 | if (freeScientist > 0 && freeSpaceLab > 0) |
| 314 | { |
| 315 | change = std::min(std::min(freeScientist, freeSpaceLab), change); |
| 316 | _project->setAssigned(_project->getAssigned()+change); |
| 317 | _base->setScientists(_base->getScientists()-change); |
| 318 | setAssignedScientist(); |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | /** |
| 323 | * Removes one scientist from the project if possible. |
nothing calls this directly
no test coverage detected