diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-01-11 13:15:02 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-01-11 13:15:02 +0100 |
commit | 09caff2b2a06d1f8ac8203567035a21c612165f9 (patch) | |
tree | 999be04ff0a418a33e438be9befc8c9297e383f4 /src/Model/Unit/MailCarrier.php | |
parent | 6301f63bd348109b8693a922f02e16d49205a8fd (diff) |
send resources
Diffstat (limited to 'src/Model/Unit/MailCarrier.php')
-rw-r--r-- | src/Model/Unit/MailCarrier.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Model/Unit/MailCarrier.php b/src/Model/Unit/MailCarrier.php new file mode 100644 index 0000000..c787e22 --- /dev/null +++ b/src/Model/Unit/MailCarrier.php @@ -0,0 +1,34 @@ +<?php + +namespace App\Model\Unit; + +use App\Model\Unit; +use App\Model\Village; + +class MailCarrier extends Unit +{ + public string $buildingType = 'PostOffice'; + public int $buildTimeFactor = 5; + public int $travelTime = 1; + public int $populationDemandFactor = 1; + + public array $resourceRequirementsBase = [ + 'wood' => 200, + 'clay' => 200, + 'iron' => 200, + 'food' => 200, + ]; + public array $resourceRequirementsFactor = [ + 'wood' => 2.0, + 'clay' => 2.0, + 'iron' => 2.0, + 'food' => 2.0, + ]; + + public static function getResourceCapabilities(Village|int $village): int + { + $postOffice = Village::getBuilding($village->id ?? $village, 'PostOffice'); + + return $postOffice->level * 100; + } +} |