| 564 | } |
| 565 | |
| 566 | int Base::getUsage(GameState &state, sp<Facility> facility, int delta) const |
| 567 | { |
| 568 | if (facility->lab) |
| 569 | { |
| 570 | float usage = 0.0f; |
| 571 | if (delta != 0) |
| 572 | { |
| 573 | LogError("Delta is only supposed to be used with stores, alien containment and LQ!"); |
| 574 | } |
| 575 | if (facility->lab->current_project) |
| 576 | { |
| 577 | usage = (float)facility->lab->assigned_agents.size(); |
| 578 | usage /= facility->type->capacityAmount; |
| 579 | } |
| 580 | return static_cast<int>(ceilf(usage * 100.0f)); |
| 581 | } |
| 582 | else |
| 583 | { |
| 584 | return getUsage(state, facility->type->capacityType, delta); |
| 585 | } |
| 586 | } |
| 587 | |
| 588 | int Base::getUsage(GameState &state, FacilityType::Capacity type, int delta) const |
| 589 | { |
no test coverage detected