From a4186ab0762833a4c4dd741e6dd112185efc2272 Mon Sep 17 00:00:00 2001 From: Fibinger Ádám <adam.fibinger@wup.hu> Date: Thu, 17 Oct 2019 16:51:42 +0200 Subject: [PATCH] History felület alapok és némi refaktor --- EOG/Models/MatchHistory.php | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/EOG/Models/MatchHistory.php b/EOG/Models/MatchHistory.php index 720edcf..cfe6f99 100644 --- a/EOG/Models/MatchHistory.php +++ b/EOG/Models/MatchHistory.php @@ -9,7 +9,7 @@ const ROLE_ATTACK = 'att'; const ROLE_DEFEND = 'def'; - protected $sites = [ + protected $maps = [ 'Bank' => [ 'CEO Office / Executive Lounge', 'Open Area / Staff Room', @@ -84,9 +84,14 @@ /** * @return array */ - public function getSites(): array + public function getMaps(): array { - return $this->sites; + return $this->maps; + } + + public function getMapNames() + { + return array_keys($this->maps); } /** @@ -95,6 +100,11 @@ public function getCurrentMap(): string { return $this->currentMap; + } + + public function getCurrentSites(): array + { + return $this->maps[$this->currentMap]; } /** @@ -107,13 +117,13 @@ private function validMap($mapName) { - $mapList = array_keys($this->sites); + $mapList = array_keys($this->maps); return in_array($mapName, $mapList); } private function validSite($siteName) { - return in_array($siteName, $this->sites[$this->currentMap]); + return in_array($siteName, $this->maps[$this->currentMap]); } public function setCurrentMap(string $mapName) -- Gitblit v1.8.0