From 09caff2b2a06d1f8ac8203567035a21c612165f9 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Thu, 11 Jan 2024 13:15:02 +0100 Subject: send resources --- src/Model/Unit/Diplomat.php | 1 + src/Model/Unit/Farmer.php | 1 + src/Model/Unit/MailCarrier.php | 34 ++++++++++++++++++++++++++++++++++ src/Model/Unit/Merchant.php | 33 --------------------------------- src/Model/Unit/Miner.php | 1 + src/Model/Unit/PitWorker.php | 1 + src/Model/Unit/WoodCutter.php | 1 + 7 files changed, 39 insertions(+), 33 deletions(-) create mode 100644 src/Model/Unit/MailCarrier.php delete mode 100644 src/Model/Unit/Merchant.php (limited to 'src/Model/Unit') diff --git a/src/Model/Unit/Diplomat.php b/src/Model/Unit/Diplomat.php index baee88a..b96f3ca 100644 --- a/src/Model/Unit/Diplomat.php +++ b/src/Model/Unit/Diplomat.php @@ -7,6 +7,7 @@ use App\Model\Unit; class Diplomat extends Unit { public string $buildingType = 'Embassy'; + public int $buildTimeFactor = 10; public int $travelTime = 1; public int $populationDemandFactor = 1; diff --git a/src/Model/Unit/Farmer.php b/src/Model/Unit/Farmer.php index 5256bf1..585a1f6 100644 --- a/src/Model/Unit/Farmer.php +++ b/src/Model/Unit/Farmer.php @@ -7,6 +7,7 @@ use App\Model\Unit; class Farmer extends Unit { public string $buildingType = 'Farm'; + public int $buildTimeFactor = 1; public int $travelTime = 1; public int $populationDemandFactor = 1; 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 @@ + 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; + } +} diff --git a/src/Model/Unit/Merchant.php b/src/Model/Unit/Merchant.php deleted file mode 100644 index be0b25e..0000000 --- a/src/Model/Unit/Merchant.php +++ /dev/null @@ -1,33 +0,0 @@ - 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 - { - $marketplace = Village::getBuilding($village->id ?? $village, 'Marketplace'); - - return $marketplace->level * 100; - } -} diff --git a/src/Model/Unit/Miner.php b/src/Model/Unit/Miner.php index 06c6dda..e6a9021 100644 --- a/src/Model/Unit/Miner.php +++ b/src/Model/Unit/Miner.php @@ -7,6 +7,7 @@ use App\Model\Unit; class Miner extends Unit { public string $buildingType = 'IronMine'; + public int $buildTimeFactor = 1; public int $travelTime = 1; public int $populationDemandFactor = 1; diff --git a/src/Model/Unit/PitWorker.php b/src/Model/Unit/PitWorker.php index f2a27b6..03463b1 100644 --- a/src/Model/Unit/PitWorker.php +++ b/src/Model/Unit/PitWorker.php @@ -7,6 +7,7 @@ use App\Model\Unit; class PitWorker extends Unit { public string $buildingType = 'ClayPit'; + public int $buildTimeFactor = 1; public int $travelTime = 1; public int $populationDemandFactor = 1; diff --git a/src/Model/Unit/WoodCutter.php b/src/Model/Unit/WoodCutter.php index 02aea85..f3478b2 100644 --- a/src/Model/Unit/WoodCutter.php +++ b/src/Model/Unit/WoodCutter.php @@ -7,6 +7,7 @@ use App\Model\Unit; class WoodCutter extends Unit { public string $buildingType = 'WoodCutter'; + public int $buildTimeFactor = 1; public int $travelTime = 1; public int $populationDemandFactor = 1; -- cgit v1.2.3