diff --git a/core/Maps/MapManager.php b/core/Maps/MapManager.php index e14cd970..6fb3b792 100644 --- a/core/Maps/MapManager.php +++ b/core/Maps/MapManager.php @@ -715,6 +715,21 @@ class MapManager implements CallbackListener, CommunicationListener { return true; } + /** + * Returns the Map by it's given Array Index + * + * @param int $index The index starts at 0 + * @return Map|null + */ + public function getMapByIndex($index) { + $maps = $this->getMaps(); + if ($index > sizeof($maps)) { + return null; + } else { + return $maps[$index]; + } + } + /** * Returns the MapIndex of a given map *