Crossfire Server, Trunk
ScriptFileManager.h
Go to the documentation of this file.
1 #ifndef SCRIPT_FILE_MANAGER_H
2 #define SCRIPT_FILE_MANAGER_H
3 
4 #include <QHash>
5 #include "assets/AssetWrapper.h"
6 #include "scripts/ScriptFile.h"
7 
8 class HookInformation;
10 
13  Q_OBJECT
14 
15  public:
17  virtual ~ScriptFileManager();
18 
19  virtual QString displayName() const override { return "Scripts"; }
20  virtual int childrenCount() const { return myScripts.size(); }
21  virtual AssetWrapper *child(int child) { return myScripts.values()[child]; }
22  virtual int childIndex(AssetWrapper *child) { return myScripts.values().indexOf(dynamic_cast<ScriptFile *>(child)); }
23 
24  QList<ScriptFile*> scriptsForMap(CREMapInformation* map);
25 
31  ScriptFile* getFile(const QString& path);
32 
38 
39  QList<ScriptFile*> scripts() const;
40 
41  public slots:
42  void addHook(const QString &file, HookInformation *hook);
43 
44  private:
45  QHash<QString, ScriptFile*> myScripts;
46 };
47 
48 #endif /* SCRIPT_FILE_MANAGER_H */
ScriptFileManager
Definition: ScriptFileManager.h:12
ScriptFileManager::displayName
virtual QString displayName() const override
Definition: ScriptFileManager.h:19
AssetWrapper.h
ScriptFileManager::myScripts
QHash< QString, ScriptFile * > myScripts
Definition: ScriptFileManager.h:45
python_event.path
path
Definition: python_event.py:11
mad_mage_user.file
file
Definition: mad_mage_user.py:15
CREMapInformation
Definition: CREMapInformation.h:16
disinfect.map
map
Definition: disinfect.py:4
ScriptFile.h
ScriptFileManager::scriptsForMap
QList< ScriptFile * > scriptsForMap(CREMapInformation *map)
Definition: ScriptFileManager.cpp:14
AssetWrapper
Definition: AssetWrapper.h:11
ScriptFileManager::removeMap
void removeMap(CREMapInformation *map)
Definition: ScriptFileManager.cpp:36
ScriptFileManager::childrenCount
virtual int childrenCount() const
Definition: ScriptFileManager.h:20
ScriptFileManager::ScriptFileManager
ScriptFileManager(AssetWrapper *parent)
Definition: ScriptFileManager.cpp:5
ScriptFileManager::scripts
QList< ScriptFile * > scripts() const
Definition: ScriptFileManager.cpp:54
ScriptFile
Definition: ScriptFile.h:31
ScriptFileManager::getFile
ScriptFile * getFile(const QString &path)
Definition: ScriptFileManager.cpp:27
ScriptFileManager::child
virtual AssetWrapper * child(int child)
Definition: ScriptFileManager.h:21
HookInformation
Definition: ScriptFile.h:10
ScriptFileManager::~ScriptFileManager
virtual ~ScriptFileManager()
Definition: ScriptFileManager.cpp:9
ScriptFileManager::childIndex
virtual int childIndex(AssetWrapper *child)
Definition: ScriptFileManager.h:22
ScriptFileManager::addHook
void addHook(const QString &file, HookInformation *hook)
Definition: ScriptFileManager.cpp:59