summaryrefslogtreecommitdiff
path: root/src/Model/Building/Storage.php
blob: fde4c4e4d7706c3b0c65f15e938e8b9cb74d00ee (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
<?php

namespace App\Model\Building;

use App\Model\Building;
use App\Model\Village;

class Storage extends Building
{
  public int $buildTimeFactor = 1;
  public int $maxLevel = 25;

  public array $resourceRequirements = [
    'wood' => 1.0,
  ];

  public function getCapacity(): int
  {
    return $this->level * 2560;
  }

  public function getResourceCapacity(string $resourceType): int
  {
    $p = Village::getStorageConfig($this->villageId)->$resourceType / 100;

    return ceil($this->getCapacity() * $p);
  }
}