From fa00b957378a393f8edbfc98ef111d35d18ecb09 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 24 Sep 2023 13:40:25 +0200 Subject: initial commit --- src/Model/Building/Storage.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/Model/Building/Storage.php (limited to 'src/Model/Building/Storage.php') 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 @@ + 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); + } +} -- cgit v1.2.3