Crossfire Server, Trunk  R20513
CREMapInformationManager.h
Go to the documentation of this file.
1 #ifndef CLASS_CRE_MAP_INFORMATION_MANAGER_H
2 #define CLASS_CRE_MAP_INFORMATION_MANAGER_H
3 
4 #include <QtCore>
5 #include "CREMapInformation.h"
6 
7 extern "C" {
8 #include "global.h"
9 }
10 
11 class MessageManager;
12 class QuestManager;
13 class ScriptFileManager;
14 class CRERandomMap;
15 
16 class CREMapInformationManager : public QObject
17 {
18  Q_OBJECT
19 
20  public:
21  CREMapInformationManager(QObject* parent, MessageManager* messageManager, QuestManager* questManager, ScriptFileManager* scriptManager);
22  virtual ~CREMapInformationManager();
23 
24  bool browseFinished() const;
25  void start();
26  void cancel();
27  void clearCache();
28 
29  QList<CREMapInformation*> allMaps();
30  QList<CREMapInformation*> getArchetypeUse(const archetype* arch);
31  QList<CREMapInformation*> getMapsForRegion(const QString& region);
32  QList<CRERandomMap*> randomMaps();
33 
34  signals:
35  void browsingMap(const QString& path);
36  void finished();
37 
38  protected:
42  QHash<QString, CREMapInformation*> myInformation;
43  QMultiHash<QString, CREMapInformation*> myArchetypeUse;
44  QStringList myToProcess;
46  QFuture<void> myWorker;
48  QMutex myLock;
49  QHash<QString, qint64> myExperience;
50 
51  void browseMaps();
52  void process(const QString& path);
53  void checkInventory(const object* item, CREMapInformation* information, const object* env);
54  void loadCache();
55  void storeCache();
56  CREMapInformation* getOrCreateMapInformation(const QString& path);
57  void addArchetypeUse(const QString& name, CREMapInformation* map);
58  void checkEvent(const object* item, CREMapInformation* map, const object* env);
59 };
60 
61 #endif // CLASS_CRE_MAP_INFORMATION_MANAGER_H
void process(const QString &path)
QList< CREMapInformation * > allMaps()
ScriptFileManager * myScriptManager
Manage scripts for items.
QList< CREMapInformation * > getMapsForRegion(const QString &region)
Global type definitions and header inclusions.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:465
QMultiHash< QString, CREMapInformation * > myArchetypeUse
QList< CREMapInformation * > getArchetypeUse(const archetype *arch)
QHash< QString, CREMapInformation * > myInformation
void checkInventory(const object *item, CREMapInformation *information, const object *env)
This is a game region.
Definition: map.h:276
void browsingMap(const QString &path)
void checkEvent(const object *item, CREMapInformation *map, const object *env)
QHash< QString, qint64 > myExperience
QList< CRERandomMap * > randomMaps()
void addArchetypeUse(const QString &name, CREMapInformation *map)
CREMapInformation * getOrCreateMapInformation(const QString &path)
CREMapInformationManager(QObject *parent, MessageManager *messageManager, QuestManager *questManager, ScriptFileManager *scriptManager)