From 254eb4a9959e4c281fdeb47378a654de978cb1e4 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 15 Jan 2024 13:43:05 +0100 Subject: events and satisfaction --- src/Model/Building/Farm.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/Model/Building/Farm.php') 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; } -- cgit v1.2.3