1.0, 'clay' => 1.0, 'iron' => 1.0, ]; public string $resourceType = 'food'; public function getResourceIncrementor(): int { $populationDemand = array_reduce( Village::getUnits($this->villageId, Village::FETCH_UNIT_RESIDENCE), function ($carry, Unit $unit) { return $carry + $unit->getPopulationDemand(); } ); return parent::getResourceIncrementor() - $populationDemand; } }