summaryrefslogtreecommitdiff
path: root/src/game-server/itemmanager.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/itemmanager.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/itemmanager.hpp')
-rw-r--r--src/game-server/itemmanager.hpp41
1 files changed, 18 insertions, 23 deletions
diff --git a/src/game-server/itemmanager.hpp b/src/game-server/itemmanager.hpp
index a144fa87..25e3e94b 100644
--- a/src/game-server/itemmanager.hpp
+++ b/src/game-server/itemmanager.hpp
@@ -24,31 +24,26 @@
#ifndef _TMW_ITEMMANAGER_H
#define _TMW_ITEMMANAGER_H
-#include <map>
+#include <string>
-#include "game-server/item.hpp"
+class ItemClass;
-/**
- * The Item Manager loads the item reference database
- * and also offers an API to items information, and more.
- */
-class ItemManager
+namespace ItemManager
{
- public:
- /**
- * Constructor (loads item reference file)
- */
- ItemManager(std::string const &itemReferenceFile);
-
- /**
- * Gives an Item having the demanded information.
- */
- ItemClass *getItem(int itemId) const;
-
- private:
- std::map< int, ItemClass * > mItemReference; /**< Item reference */
-};
-
-extern ItemManager *itemManager;
+ /**
+ * Loads item reference file.
+ */
+ void initialize(std::string const &);
+
+ /**
+ * Destroy item classes.
+ */
+ void deinitialize();
+
+ /**
+ * Gets the ItemClass having the given ID.
+ */
+ ItemClass *getItem(int itemId);
+}
#endif