summaryrefslogtreecommitdiff
path: root/src/game-server/mapmanager.hpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-07 18:06:29 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-07 18:06:29 +0000
commitd213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399 (patch)
tree2ae7c7abd8fdedb2e6ec5610718834d9a92a467f /src/game-server/mapmanager.hpp
parent04e694b067a21dee8e13368c17d1815cc0624ce4 (diff)
downloadmanaserv-d213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399.tar.gz
manaserv-d213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399.tar.bz2
manaserv-d213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399.tar.xz
manaserv-d213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399.zip
Singleton managers do not need stateful classes. Changed them to namespace interfaces.
Diffstat (limited to 'src/game-server/mapmanager.hpp')
-rw-r--r--src/game-server/mapmanager.hpp65
1 files changed, 28 insertions, 37 deletions
diff --git a/src/game-server/mapmanager.hpp b/src/game-server/mapmanager.hpp
index 63ef32cd..432b0b1a 100644
--- a/src/game-server/mapmanager.hpp
+++ b/src/game-server/mapmanager.hpp
@@ -29,43 +29,34 @@
class MapComposite;
-/**
- * MapManager loads/unloads maps
- */
-class MapManager
+namespace MapManager
{
- public:
- typedef std::map< int, MapComposite * > Maps;
-
- /**
- * Constructor (loads map reference file).
- */
- MapManager(std::string const &);
-
- /**
- * Returns the requested map.
- */
- MapComposite *getMap(int);
-
- /**
- * Returns all the maps.
- */
- Maps const &getMaps() const { return maps; }
-
- /**
- * Sets the activity status of the map.
- */
- void raiseActive(int);
-
- /**
- * Destructor.
- */
- ~MapManager();
-
- private:
- Maps maps;
-};
-
-extern MapManager *mapManager;
+ typedef std::map< int, MapComposite * > Maps;
+
+ /**
+ * Loads map reference file and prepares maps.
+ */
+ void initialize(std::string const &);
+
+ /**
+ * Destroy loaded maps.
+ */
+ void deinitialize();
+
+ /**
+ * Returns the requested map.
+ */
+ MapComposite *getMap(int);
+
+ /**
+ * Returns all the maps.
+ */
+ Maps const &getMaps();
+
+ /**
+ * Sets the activity status of the map.
+ */
+ void raiseActive(int);
+}
#endif