summaryrefslogtreecommitdiff
path: root/src/Model/Unit/MailCarrier.php
blob: c787e22838134ed5a87ca1c40bbe2cb7f0aaf833 (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
33
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;
  }
}