Crossfire Server, Trunk
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 #include "quest.h"
10 }
11 
12 class MessageManager;
13 class ScriptFileManager;
14 class HookInformation;
15 class RandomMap;
16 
17 class CREMapInformationManager : public QObject
18 {
19  Q_OBJECT
20 
21  public:
22  CREMapInformationManager(QObject* parent, MessageManager* messageManager, ScriptFileManager* scriptManager);
23  virtual ~CREMapInformationManager();
24 
25  bool browseFinished() const;
26  void start();
27  void cancel();
28  void clearCache();
29 
30  QList<CREMapInformation*> allMaps();
31  QList<CREMapInformation*> getArchetypeUse(const archetype* arch);
32  QList<CREMapInformation*> getFaceUse(const Face* face);
33  QList<CREMapInformation*> getAnimationUse(const Animations* anim);
34  QList<CREMapInformation*> getMapsForRegion(const QString& region);
35  QList<CREMapInformation*> getMapsForQuest(const quest_definition *quest);
36  QList<RandomMap*> randomMaps();
37 
38  signals:
39  void browsingMap(const QString& path);
40  void finished();
41  void addHook(const QString &file, HookInformation *hook);
43 
44  protected:
47  QHash<QString, CREMapInformation*> myInformation;
48  QMultiHash<QString, CREMapInformation*> myArchetypeUse;
49  QMultiHash<QString, CREMapInformation*> myFaceUse;
50  QMultiHash<QString, CREMapInformation*> myAnimationUse;
51  QMultiHash<QString, CREMapInformation*> myQuestUse;
52  QStringList myToProcess;
54  QFuture<void> myWorker;
56  QMutex myLock;
57  QHash<QString, qint64> myExperience;
58 
59  void browseMaps();
60  void process(const QString& path);
61  void checkItem(const object* item, CREMapInformation* information, const object* env);
62  void loadCache();
63  void storeCache();
65  void addArchetypeUse(const QString& name, CREMapInformation* map);
66  void addFaceUse(const QString& name, CREMapInformation* map);
67  void addAnimationUse(const QString& name, CREMapInformation* map);
68  void addQuestUse(const QString &name, CREMapInformation *map);
69  void checkEvent(const object* item, CREMapInformation* map, const object* env);
70  void recurseStyleDirectory(const QString& from);
72 };
73 
74 #endif // CLASS_CRE_MAP_INFORMATION_MANAGER_H
ScriptFileManager
Definition: ScriptFileManager.h:12
Face
Definition: face.h:14
RandomMap
Definition: RandomMap.h:14
CREMapInformationManager::finished
void finished()
global.h
CREMapInformationManager::~CREMapInformationManager
virtual ~CREMapInformationManager()
Definition: CREMapInformationManager.cpp:63
CREMapInformationManager::myCurrentMap
int myCurrentMap
Definition: CREMapInformationManager.h:53
CREMapInformationManager::randomMaps
QList< RandomMap * > randomMaps()
Definition: CREMapInformationManager.cpp:782
CREMapInformationManager::checkItem
void checkItem(const object *item, CREMapInformation *information, const object *env)
Definition: CREMapInformationManager.cpp:81
CREMapInformationManager::browsingMap
void browsingMap(const QString &path)
CREMapInformationManager::fixMapInformation
void fixMapInformation(CREMapInformation *map)
Definition: CREMapInformationManager.cpp:813
archininventory.arch
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
Definition: archininventory.py:16
CREMapInformation.h
CREMapInformationManager::start
void start()
Definition: CREMapInformationManager.cpp:73
CREMapInformationManager::addHook
void addHook(const QString &file, HookInformation *hook)
CREMapInformationManager::clearCache
void clearCache()
Definition: CREMapInformationManager.cpp:775
CREMapInformationManager::myWorker
QFuture< void > myWorker
Definition: CREMapInformationManager.h:54
python_event.path
path
Definition: python_event.py:11
mad_mage_user.file
file
Definition: mad_mage_user.py:15
CREMapInformationManager::getAnimationUse
QList< CREMapInformation * > getAnimationUse(const Animations *anim)
Definition: CREMapInformationManager.cpp:370
CREMapInformationManager::allMaps
QList< CREMapInformation * > allMaps()
Definition: CREMapInformationManager.cpp:352
CREMapInformationManager::getArchetypeUse
QList< CREMapInformation * > getArchetypeUse(const archetype *arch)
Definition: CREMapInformationManager.cpp:358
CREMapInformationManager::myCancelled
bool myCancelled
Definition: CREMapInformationManager.h:55
CREMapInformationManager::process
void process(const QString &path)
Definition: CREMapInformationManager.cpp:180
CREMapInformationManager::addArchetypeUse
void addArchetypeUse(const QString &name, CREMapInformation *map)
Definition: CREMapInformationManager.cpp:688
CREMapInformationManager::myExperience
QHash< QString, qint64 > myExperience
Definition: CREMapInformationManager.h:57
CREMapInformationManager::addAnimationUse
void addAnimationUse(const QString &name, CREMapInformation *map)
Definition: CREMapInformationManager.cpp:702
archt
Definition: object.h:468
CREMapInformationManager::recurseStyleDirectory
void recurseStyleDirectory(const QString &from)
Definition: CREMapInformationManager.cpp:792
CREMapInformation
Definition: CREMapInformation.h:16
quest
Definition: quest.py:1
CREMapInformationManager::CREMapInformationManager
CREMapInformationManager(QObject *parent, MessageManager *messageManager, ScriptFileManager *scriptManager)
Definition: CREMapInformationManager.cpp:54
disinfect.map
map
Definition: disinfect.py:4
CREMapInformationManager::myAnimationUse
QMultiHash< QString, CREMapInformation * > myAnimationUse
Definition: CREMapInformationManager.h:50
MessageManager
Definition: MessageManager.h:13
animate.anim
string anim
Definition: animate.py:20
CREMapInformationManager::myScriptManager
ScriptFileManager * myScriptManager
Definition: CREMapInformationManager.h:46
CREMapInformationManager::myArchetypeUse
QMultiHash< QString, CREMapInformation * > myArchetypeUse
Definition: CREMapInformationManager.h:48
CREMapInformationManager::browseFinished
bool browseFinished() const
Definition: CREMapInformationManager.cpp:68
env
static std::shared_ptr< inja::Environment > env
Definition: mapper.cpp:2215
CREMapInformationManager::getMapsForRegion
QList< CREMapInformation * > getMapsForRegion(const QString &region)
Definition: CREMapInformationManager.cpp:762
animations_struct
Definition: face.h:25
quest.h
CREMapInformationManager::myLock
QMutex myLock
Definition: CREMapInformationManager.h:56
CREMapInformationManager::myFaceUse
QMultiHash< QString, CREMapInformation * > myFaceUse
Definition: CREMapInformationManager.h:49
CREMapInformationManager::getOrCreateMapInformation
CREMapInformation * getOrCreateMapInformation(const QString &path)
Definition: CREMapInformationManager.cpp:678
CREMapInformationManager::myToProcess
QStringList myToProcess
Definition: CREMapInformationManager.h:52
CREMapInformationManager::addQuestUse
void addQuestUse(const QString &name, CREMapInformation *map)
Definition: CREMapInformationManager.cpp:709
CREMapInformationManager::browseMaps
void browseMaps()
Definition: CREMapInformationManager.cpp:288
item
Definition: item.py:1
CREMapInformationManager::addFaceUse
void addFaceUse(const QString &name, CREMapInformation *map)
Definition: CREMapInformationManager.cpp:695
quest_definition
Definition: quest.h:42
CREMapInformationManager::checkEvent
void checkEvent(const object *item, CREMapInformation *map, const object *env)
Definition: CREMapInformationManager.cpp:716
CREMapInformationManager::cancel
void cancel()
Definition: CREMapInformationManager.cpp:346
CREMapInformationManager::loadCache
void loadCache()
Definition: CREMapInformationManager.cpp:382
CREMapInformationManager::myInformation
QHash< QString, CREMapInformation * > myInformation
Definition: CREMapInformationManager.h:47
CREMapInformationManager::mapAdded
void mapAdded(CREMapInformation *map)
CREMapInformationManager::getMapsForQuest
QList< CREMapInformation * > getMapsForQuest(const quest_definition *quest)
Definition: CREMapInformationManager.cpp:376
CREMapInformationManager::myMessageManager
MessageManager * myMessageManager
Definition: CREMapInformationManager.h:45
CREMapInformationManager::getFaceUse
QList< CREMapInformation * > getFaceUse(const Face *face)
Definition: CREMapInformationManager.cpp:364
CREMapInformationManager::myQuestUse
QMultiHash< QString, CREMapInformation * > myQuestUse
Definition: CREMapInformationManager.h:51
CREMapInformationManager
Definition: CREMapInformationManager.h:17
HookInformation
Definition: ScriptFile.h:10
CREMapInformationManager::storeCache
void storeCache()
Definition: CREMapInformationManager.cpp:557
give.name
name
Definition: give.py:27
regiondef
Definition: map.h:275