summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mapmanager.cpp13
-rw-r--r--src/mapmanager.h5
2 files changed, 18 insertions, 0 deletions
diff --git a/src/mapmanager.cpp b/src/mapmanager.cpp
index 6e8137d1..4ce5e398 100644
--- a/src/mapmanager.cpp
+++ b/src/mapmanager.cpp
@@ -73,5 +73,18 @@ void MapManager::reloadMap(const std::string& mapFile)
loadMap(mapFile);
}
+Map *MapManager::getMap(const std::string& mapFile)
+{
+ Map *result = NULL;
+ std::map<std::string, Map *>::iterator i;
+
+ i = maps.find(mapFile);
+ if (i != maps.end())
+ {
+ result = i->second;
+ }
+ return result;
+}
+
} // namespace tmwserv
diff --git a/src/mapmanager.h b/src/mapmanager.h
index c4051c4a..e4edf196 100644
--- a/src/mapmanager.h
+++ b/src/mapmanager.h
@@ -57,6 +57,11 @@ class MapManager: public utils::Singleton<MapManager>
* Reload the specified map
*/
void reloadMap(const std::string& mapFile);
+
+ /**
+ * Return the requested map
+ */
+ Map *getMap(const std::string& mapFile);
protected:
/**