summaryrefslogtreecommitdiff
path: root/src/Model/Building/Farm.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-01-15 13:43:05 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-01-15 13:43:05 +0100
commit254eb4a9959e4c281fdeb47378a654de978cb1e4 (patch)
treec2c4bb19e2c16cddc82988f50de79c718f381b22 /src/Model/Building/Farm.php
parent09caff2b2a06d1f8ac8203567035a21c612165f9 (diff)
events and satisfaction
Diffstat (limited to 'src/Model/Building/Farm.php')
-rw-r--r--src/Model/Building/Farm.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/Model/Building/Farm.php b/src/Model/Building/Farm.php
index 1a69c89..7957dca 100644
--- a/src/Model/Building/Farm.php
+++ b/src/Model/Building/Farm.php
@@ -2,7 +2,6 @@
namespace App\Model\Building;
-use App\Model\Unit;
use App\Model\Village;
class Farm extends ResourceGenerator
@@ -26,12 +25,7 @@ class Farm extends ResourceGenerator
public function getResourceIncrementor(): int
{
- $populationDemand = array_reduce(
- Village::getUnits($this->villageId, Village::FETCH_UNIT_RESIDENCE, Village::RETURN_UNIT_EXISTING),
- function ($carry, Unit $unit) {
- return $carry + $unit->getPopulationDemand();
- }
- );
+ $populationDemand = Village::getPopulationDemand($this->villageId);
return parent::getResourceIncrementor() - $populationDemand;
}