MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / getUsage

Method getUsage

game/state/city/base.cpp:566–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

564}
565
566int 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
588int Base::getUsage(GameState &state, FacilityType::Capacity type, int delta) const
589{

Callers 11

updateHourlyMethod · 0.80
closeScreenMethod · 0.80
closeScreenMethod · 0.80
eventOccurredMethod · 0.80
RecruitScreenMethod · 0.80
updateBaseHighlightMethod · 0.80
closeScreenMethod · 0.80
updateBaseHighlightMethod · 0.80
closeScreenMethod · 0.80
updateBaseHighlightMethod · 0.80
updateMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected