blob: 8978003566656b205c92a1632e582099f870b227 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<?php
namespace App\Model\Building;
use App\Model\Building;
use App\Model\Unit\Merchant;
use App\Model\Village;
class Marketplace extends Building
{
public string $unitType = 'Merchant';
public int $buildTimeFactor = 1;
public int $maxLevel = 25;
public array $resourceRequirementsBase = [
'wood' => 1000,
'clay' => 1000,
'iron' => 800,
];
public array $resourceRequirementsFactor = [
'wood' => 10.0,
'clay' => 10.0,
'iron' => 8.0,
];
public static function getResourceCapabilities(Village $village): int
{
$merchants = Village::getUnit($village, 'Merchant', Village::FETCH_UNIT_RESIDENCE, Village::RETURN_UNIT_EXISTING);
return Merchant::getResourceCapabilities($village) * $merchants->amount;
}
}
|