Crossfire Server, Trunk  R20608
Quest.h
Go to the documentation of this file.
1 #ifndef _QUEST_H
2 #define _QUEST_H
3 
4 #include <QObject>
5 #include <QStringList>
6 
8 
9 class QuestStep : public QObject
10 {
11  Q_OBJECT
12 
13  public:
14  QuestStep();
15 
16  int step() const;
17  void setStep(int step);
18  const QString& description() const;
19  void setDescription(const QString& description);
20  bool isCompletion() const;
21  void setCompletion(bool completion);
22  const QStringList& setWhen() const;
23  QStringList& setWhen();
24 
25  private:
26  int myStep;
27  QString myDescription;
29  QStringList mySetWhen;
30 };
31 
32 class Quest : public QObject
33 {
34  Q_OBJECT
35 
36  public:
37  Quest();
38  virtual ~Quest();
39 
40  const QString& code() const;
41  void setCode(const QString& code);
42  const QString& title() const;
43  void setTitle(const QString& title);
44  const QString& face() const;
45  void setFace(const QString& face);
46  int faceNumber() const;
47  void setFaceNumber(int face);
48  const QString& description()const;
49  void setDescription(const QString& description);
50  bool canRestart() const;
51  void setRestart(bool restart);
52  QList<const QuestStep*> steps() const;
53  QList<QuestStep*>& steps();
54 
55  bool isModified() const;
56  void setModified(bool modified);
57  const Quest* parent() const;
58  void setParent(Quest* parent);
59 
60  QList<CREMapInformation*>& maps();
61 
62  signals:
63  void modified();
64 
65  private:
66  QString myCode;
67  QString myTitle;
68  QString myFace;
69  // only used for display purposes, filled by CREResourcesWindow::fillQuests().
71  QString myDescription;
73  QList<QuestStep*> mySteps;
74  bool myModified;
76  QList<CREMapInformation*> myMaps;
77 
78  void markModified();
79 };
80 
81 #endif /* _QUEST_H */
void setRestart(bool restart)
Definition: Quest.cpp:130
QString myTitle
Definition: Quest.h:67
const QStringList & setWhen() const
Definition: Quest.cpp:39
const Quest * parent() const
Definition: Quest.cpp:166
Definition: Quest.h:32
QList< const QuestStep * > steps() const
Definition: Quest.cpp:138
const QString & code() const
Definition: Quest.cpp:63
int myFaceNumber
Definition: Quest.h:70
void setTitle(const QString &title)
Definition: Quest.cpp:81
int faceNumber() const
Definition: Quest.cpp:102
void setStep(int step)
Definition: Quest.cpp:14
QString myCode
Definition: Quest.h:66
int myStep
Definition: Quest.h:26
const QString & face() const
Definition: Quest.cpp:89
QList< QuestStep * > mySteps
Definition: Quest.h:73
const QString & description() const
Definition: Quest.cpp:112
QString myFace
Definition: Quest.h:68
QList< CREMapInformation * > myMaps
Definition: Quest.h:76
bool myCanRestart
Definition: Quest.h:72
void modified()
const QString & title() const
Definition: Quest.cpp:76
Quest * myParent
Definition: Quest.h:75
void setDescription(const QString &description)
Definition: Quest.cpp:117
bool isModified() const
Definition: Quest.cpp:151
QStringList mySetWhen
Definition: Quest.h:29
Definition: Quest.h:9
bool myIsCompletion
Definition: Quest.h:28
void setCompletion(bool completion)
Definition: Quest.cpp:34
QString myDescription
Definition: Quest.h:71
virtual ~Quest()
Definition: Quest.cpp:58
bool canRestart() const
Definition: Quest.cpp:125
void setCode(const QString &code)
Definition: Quest.cpp:68
int step() const
Definition: Quest.cpp:9
void setParent(Quest *parent)
Definition: Quest.cpp:171
const QString & description() const
Definition: Quest.cpp:19
QuestStep()
Definition: Quest.cpp:3
bool isCompletion() const
Definition: Quest.cpp:29
void setFaceNumber(int face)
Definition: Quest.cpp:107
void markModified()
Definition: Quest.cpp:160
void setDescription(const QString &description)
Definition: Quest.cpp:24
void setModified(bool modified)
Definition: Quest.cpp:155
bool myModified
Definition: Quest.h:74
QString myDescription
Definition: Quest.h:27
void setFace(const QString &face)
Definition: Quest.cpp:94
Quest()
Definition: Quest.cpp:50
QList< CREMapInformation * > & maps()
Definition: Quest.cpp:180