diff options
Diffstat (limited to 'src/Model/Building/Storage.php')
-rw-r--r-- | src/Model/Building/Storage.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Model/Building/Storage.php b/src/Model/Building/Storage.php new file mode 100644 index 0000000..fde4c4e --- /dev/null +++ b/src/Model/Building/Storage.php @@ -0,0 +1,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); + } +} |