From 73bdeca4d24955081168a33d1e8e4bd1615a13d5 Mon Sep 17 00:00:00 2001 From: kremsy Date: Wed, 13 Aug 2014 11:42:10 +0200 Subject: [PATCH] get's a map by its mxid --- application/core/Maps/MapManager.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 953d31b9..a02876c4 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -470,6 +470,21 @@ class MapManager implements CallbackListener { return null; } + /** + * Get's a Map by it's Mania-Exchange Id + * + * @param $mxId + * @return Map + */ + public function getMapByMxId($mxId) { + foreach ($this->maps as $map) { + if ($map->mx->id == $mxId) { + return $map; + } + } + return null; + } + /** * Updates the full Map list, needed on Init, addMap and on ShuffleMaps */