* Removes the given number of units to produce from the project if possible. * @param change How much we want to subtract. */
| 432 | * @param change How much we want to subtract. |
| 433 | */ |
| 434 | void ManufactureInfoState::lessUnit(int change) |
| 435 | { |
| 436 | if (0 >= change) return; |
| 437 | int units = _production->getAmountTotal(); |
| 438 | change = std::min(units-(_production->getAmountProduced()+1), change); |
| 439 | _production->setAmountTotal(units-change); |
| 440 | setAssignedEngineer(); |
| 441 | } |
| 442 | |
| 443 | /** |
| 444 | * Starts the timerLessUnit. |
nothing calls this directly
no test coverage detected