Crossfire Server, Trunk
MessageManager.h
Go to the documentation of this file.
1 #ifndef _MESSAGEMANAGER_H
2 #define _MESSAGEMANAGER_H
3 
4 #include "assets/AssetWrapper.h"
5 #include "MessageFile.h"
6 #include <QList>
7 
9 
13 class MessageManager : public AssetWrapper {
14  public:
16  virtual ~MessageManager();
17 
18  virtual QString displayName() const override { return "NPC dialogs"; }
19 
20  virtual int childrenCount() const override { return myMessages.size(); }
21  virtual AssetWrapper *child(int child) override { return myMessages[child]; }
22  virtual int childIndex(AssetWrapper *child) override { return myMessages.indexOf(static_cast<MessageFile *>(child)); }
23 
24  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
25 
27  void loadMessages();
29  void saveMessages();
30 
35  QList<MessageFile*>& messages();
40  const QList<MessageFile*>& messages() const;
46  MessageFile* findMessage(const QString& path);
47 
52  QList<QuestConditionScript*> preConditions() const;
57  QList<QuestConditionScript*> postConditions() const;
58 
59  private:
60  QList<MessageFile*> myMessages;
61  QList<QuestConditionScript*> myPreConditions;
62  QList<QuestConditionScript*> myPostConditions;
63 
64  QString loadScriptComment(const QString& path) const;
65  void loadDirectory(const QString& directory);
66  void findPrePost(const QString directory, QList<QuestConditionScript*>& list);
67 };
68 
69 #endif /* _MESSAGEMANAGER_H */
MessageManager::loadScriptComment
QString loadScriptComment(const QString &path) const
Definition: MessageManager.cpp:101
MessageManager::myPreConditions
QList< QuestConditionScript * > myPreConditions
Definition: MessageManager.h:61
QuestConditionScript
Definition: QuestConditionScript.h:9
AssetWrapper.h
MessageManager::findMessage
MessageFile * findMessage(const QString &path)
Definition: MessageManager.cpp:51
MessageManager::loadMessages
void loadMessages()
Definition: MessageManager.cpp:24
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:14
guildoracle.list
list
Definition: guildoracle.py:87
MessageManager::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: MessageManager.cpp:134
python_event.path
path
Definition: python_event.py:11
MessageManager::messages
QList< MessageFile * > & messages()
Definition: MessageManager.cpp:41
MessageManager::MessageManager
MessageManager(AssetWrapper *parent)
Definition: MessageManager.cpp:13
MessageFile
Definition: MessageFile.h:56
MessageManager::postConditions
QList< QuestConditionScript * > postConditions() const
Definition: MessageManager.cpp:96
MessageManager::childrenCount
virtual int childrenCount() const override
Definition: MessageManager.h:20
MessageManager::myPostConditions
QList< QuestConditionScript * > myPostConditions
Definition: MessageManager.h:62
MessageManager::~MessageManager
virtual ~MessageManager()
Definition: MessageManager.cpp:17
MessageManager::preConditions
QList< QuestConditionScript * > preConditions() const
Definition: MessageManager.cpp:91
MessageManager::displayName
virtual QString displayName() const override
Definition: MessageManager.h:18
AssetWrapper
Definition: AssetWrapper.h:11
MessageManager::myMessages
QList< MessageFile * > myMessages
Definition: MessageManager.h:60
MessageManager
Definition: MessageManager.h:13
MessageFile.h
MessageManager::loadDirectory
void loadDirectory(const QString &directory)
Definition: MessageManager.cpp:62
MessageManager::child
virtual AssetWrapper * child(int child) override
Definition: MessageManager.h:21
MessageManager::childIndex
virtual int childIndex(AssetWrapper *child) override
Definition: MessageManager.h:22
MessageManager::findPrePost
void findPrePost(const QString directory, QList< QuestConditionScript * > &list)
Definition: MessageManager.cpp:124
MessageManager::saveMessages
void saveMessages()
Definition: MessageManager.cpp:33