Crossfire Server, Trunk  R20513
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 */
QString myTitle
Definition: Quest.h:67
const QStringList & setWhen() const
Definition: Quest.cpp:39
Definition: Quest.h:32
int myFaceNumber
Definition: Quest.h:70
void setStep(int step)
Definition: Quest.cpp:14
QString myCode
Definition: Quest.h:66
int myStep
Definition: Quest.h:26
QList< QuestStep * > mySteps
Definition: Quest.h:73
QString myFace
Definition: Quest.h:68
QList< CREMapInformation * > myMaps
Definition: Quest.h:76
bool myCanRestart
Definition: Quest.h:72
struct titlestruct title
Information on one title.
Quest * myParent
Definition: Quest.h:75
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
int step() const
Definition: Quest.cpp:9
const QString & description() const
Definition: Quest.cpp:19
QuestStep()
Definition: Quest.cpp:3
bool isCompletion() const
Definition: Quest.cpp:29
void setDescription(const QString &description)
Definition: Quest.cpp:24
bool myModified
Definition: Quest.h:74
QString myDescription
Definition: Quest.h:27