summaryrefslogtreecommitdiff
path: root/src/Model/Building/PostOffice.php
blob: 5765a0f503852ce4fa4c63dc3b8d0fc28df05c20 (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\MailCarrier;
use App\Model\Village;

class PostOffice extends Building
{
  public string $unitType = 'MailCarrier';
  public int $buildTimeFactor = 5;
  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
  {
    $mailCarriers = Village::getUnit($village, 'MailCarrier', Village::FETCH_UNIT_RESIDENCE, Village::RETURN_UNIT_EXISTING);

    return MailCarrier::getResourceCapabilities($village) * $mailCarriers->amount;
  }
}