summaryrefslogtreecommitdiff
path: root/src/Model/Building/Storage.php
diff options
context:
space:
mode:
authorDaniel Weipert <code@drogueronin.de>2023-09-24 13:40:25 +0200
committerDaniel Weipert <code@drogueronin.de>2023-09-24 13:40:25 +0200
commitfa00b957378a393f8edbfc98ef111d35d18ecb09 (patch)
tree654e7dc5414f7f2795dbe996d3e1570793a5b1b8 /src/Model/Building/Storage.php
initial commit
Diffstat (limited to 'src/Model/Building/Storage.php')
-rw-r--r--src/Model/Building/Storage.php28
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);
+ }
+}