summaryrefslogtreecommitdiff
path: root/src/Model/Building/Farm.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Model/Building/Farm.php')
-rw-r--r--src/Model/Building/Farm.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Model/Building/Farm.php b/src/Model/Building/Farm.php
index 222d8cd..1a69c89 100644
--- a/src/Model/Building/Farm.php
+++ b/src/Model/Building/Farm.php
@@ -11,7 +11,12 @@ class Farm extends ResourceGenerator
public int $buildTimeFactor = 1;
public int $maxLevel = 25;
- public array $resourceRequirements = [
+ public array $resourceRequirementsBase = [
+ 'wood' => 100,
+ 'clay' => 100,
+ 'iron' => 100,
+ ];
+ public array $resourceRequirementsFactor = [
'wood' => 1.0,
'clay' => 1.0,
'iron' => 1.0,
@@ -22,7 +27,7 @@ class Farm extends ResourceGenerator
public function getResourceIncrementor(): int
{
$populationDemand = array_reduce(
- Village::getUnits($this->villageId, Village::FETCH_UNIT_RESIDENCE),
+ Village::getUnits($this->villageId, Village::FETCH_UNIT_RESIDENCE, Village::RETURN_UNIT_EXISTING),
function ($carry, Unit $unit) {
return $carry + $unit->getPopulationDemand();
}