* Removes the given number of scientists from the project if possible. * @param change Number of scientists to subtract. */
| 333 | * @param change Number of scientists to subtract. |
| 334 | */ |
| 335 | void ResearchInfoState::lessByValue(int change) |
| 336 | { |
| 337 | if (0 >= change) return; |
| 338 | int assigned = _project->getAssigned(); |
| 339 | if (assigned > 0) |
| 340 | { |
| 341 | change = std::min(assigned, change); |
| 342 | _project->setAssigned(assigned-change); |
| 343 | _base->setScientists(_base->getScientists()+change); |
| 344 | setAssignedScientist(); |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | /** |
| 349 | * Runs state functionality every cycle (used to update the timer). |
nothing calls this directly
no test coverage detected