summaryrefslogtreecommitdiff
path: root/src/Model/Building/Farm.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-01-08 15:10:10 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-01-08 15:10:10 +0100
commit82875448c485d26375ed6dea4e64e940f6e10f74 (patch)
treeff2580447429309824e7d64401ad75e7f756e45e /src/Model/Building/Farm.php
parentb21316248572cb27ed1f504529ad6680a473022e (diff)
gemini
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();
}