Crossfire Server, Trunk
CREMapInformation.h
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 2022 the Crossfire Development Team
5  *
6  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7  * welcome to redistribute it under certain conditions. For details, please
8  * see COPYING and LICENSE.
9  *
10  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
11  */
12 
13 #ifndef CLASS_CRE_MAP_INFORMATION_H
14 #define CLASS_CRE_MAP_INFORMATION_H
15 
16 #include <QObject>
17 #include <QString>
18 #include <QStringList>
19 #include <QDateTime>
20 #include <QHash>
21 #include <QSet>
22 
23 #include "assets/AssetWrapper.h"
24 
25 class RandomMap;
26 
28 {
29  Q_OBJECT
30 
31  Q_PROPERTY(QString path READ path)
32  Q_PROPERTY(QString name READ name)
33  Q_PROPERTY(int difficulty READ difficulty)
35  Q_PROPERTY(qint64 experience READ experience)
36  Q_PROPERTY(QString resetGroup READ resetGroup)
37  Q_PROPERTY(QString backgroundMusic READ backgroundMusic)
38  Q_PROPERTY(double shopGreed READ shopGreed)
39  Q_PROPERTY(QString shopRace READ shopRace)
40  Q_PROPERTY(quint64 shopMin READ shopMin)
41  Q_PROPERTY(quint64 shopMax READ shopMax)
42 
43  public:
45  CREMapInformation(const QString& path);
46  virtual ~CREMapInformation();
47 
48  virtual QString displayName() const override;
49 
50  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
51 
52  const QString& path() const;
53  void setPath(const QString& path);
54 
55  const QString& name() const;
56  void setName(const QString& name);
57 
58  const QString& backgroundMusic();
59  void setBackgroundMusic(const QString& music);
60 
61  const QString& resetGroup() const;
62  void setResetGroup(const QString& resetGroup);
63 
64  QStringList archetypes() const;
65  void addArchetype(const QString& archetype);
66 
67  QStringList faces() const;
68  void addFace(const QString& face);
69 
70  QStringList animations() const;
71  void addAnimation(const QString& anim);
72 
73  const QDateTime& mapTime() const;
74  void setMapTime(const QDateTime& date);
75 
76  QStringList exitsTo() const;
77  void addExitTo(const QString& path);
78 
79  QStringList accessedFrom() const;
80  void addAccessedFrom(const QString& path);
81 
82  int difficulty() const;
83  void setDifficulty(int difficulty);
84 
85  int computedDifficulty() const;
86  void setComputedDifficulty(int computed);
87 
88  qint64 experience() const;
89  void setExperience(qint64 experience);
90 
91  const QString& region() const;
92  void setRegion(const QString& region);
93 
94  QStringList messages() const;
95  void addMessage(const QString& message);
96 
97  QStringList quests() const;
98  void addQuest(const QString& quest);
99 
100  QHash<QString, int>& shopItems();
101  const QHash<QString, int>& shopItems() const;
102 
103  double shopGreed() const;
104  void setShopGreed(double greed);
105  const QString& shopRace() const;
106  void setShopRace(const QString& race);
107  quint64 shopMin() const;
108  void setShopMin(quint64 min);
109  quint64 shopMax() const;
110  void setShopMax(quint64 max);
111 
112  QList<RandomMap*> randomMaps() const;
113  void addRandomMap(RandomMap* map);
114 
115  protected:
116  QString myPath;
117  QString myName;
118  QStringList myArchetypes;
119  QSet<QString> myFaces;
120  QSet<QString> myAnimations;
121  QDateTime myMapTime;
122  QStringList myExitsTo;
123  QStringList myAccessedFrom;
126  qint64 myExperience;
127  QString myRegion;
128  QStringList myMessages;
129  QStringList myQuests;
130  QHash<QString, int> myShopItems;
131  double myShopGreed;
132  QString myShopRace;
136  QString myResetGroup;
137 };
138 
139 #endif // CLASS_CRE_MAP_INFORMATION_H
RandomMap
Definition: RandomMap.h:24
CREMapInformation::setShopGreed
void setShopGreed(double greed)
Definition: CREMapInformation.cpp:233
CREMapInformation::myFaces
QSet< QString > myFaces
Definition: CREMapInformation.h:119
CREMapInformation::myQuests
QStringList myQuests
Definition: CREMapInformation.h:129
CREMapInformation::displayName
virtual QString displayName() const override
Definition: CREMapInformation.cpp:47
CREMapInformation::setComputedDifficulty
void setComputedDifficulty(int computed)
Definition: CREMapInformation.cpp:172
AssetWrapper.h
CREMapInformation::myAnimations
QSet< QString > myAnimations
Definition: CREMapInformation.h:120
CREMapInformation::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: CREMapInformation.cpp:278
CREMapInformation::myDifficulty
int myDifficulty
Definition: CREMapInformation.h:124
CREMapInformation::difficulty
int difficulty
Definition: CREMapInformation.h:33
CREMapInformation::myName
QString myName
Definition: CREMapInformation.h:117
send.date
date
Definition: send.py:29
CREMapInformation::exitsTo
QStringList exitsTo() const
Definition: CREMapInformation.cpp:135
CREMapInformation::setPath
void setPath(const QString &path)
Definition: CREMapInformation.cpp:59
CREMapInformation::shopRace
QString shopRace
Definition: CREMapInformation.h:39
CREMapInformation::shopItems
QHash< QString, int > & shopItems()
Definition: CREMapInformation.cpp:218
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:32
CREMapInformation::archetypes
QStringList archetypes() const
Definition: CREMapInformation.cpp:94
CREMapInformation::myMessages
QStringList myMessages
Definition: CREMapInformation.h:128
CREMapInformation::myShopMax
quint64 myShopMax
Definition: CREMapInformation.h:133
CREMapInformation::myShopItems
QHash< QString, int > myShopItems
Definition: CREMapInformation.h:130
CREMapInformation::myAccessedFrom
QStringList myAccessedFrom
Definition: CREMapInformation.h:123
CREMapInformation::setDifficulty
void setDifficulty(int difficulty)
Definition: CREMapInformation.cpp:162
CREMapInformation::myExitsTo
QStringList myExitsTo
Definition: CREMapInformation.h:122
CREMapInformation::addAnimation
void addAnimation(const QString &anim)
Definition: CREMapInformation.cpp:120
CREMapInformation::myResetGroup
QString myResetGroup
Definition: CREMapInformation.h:136
CREMapInformation::addMessage
void addMessage(const QString &message)
Definition: CREMapInformation.cpp:201
CREMapInformation::name
QString name
Definition: CREMapInformation.h:32
CREMapInformation::messages
QStringList messages() const
Definition: CREMapInformation.cpp:196
CREMapInformation::myShopRace
QString myShopRace
Definition: CREMapInformation.h:132
quest
Definition: quest.py:1
CREMapInformation
Definition: CREMapInformation.h:27
CREMapInformation::setRegion
void setRegion(const QString &region)
Definition: CREMapInformation.cpp:191
CREMapInformation::mapTime
const QDateTime & mapTime() const
Definition: CREMapInformation.cpp:125
CREMapInformation::myArchetypes
QStringList myArchetypes
Definition: CREMapInformation.h:118
disinfect.map
map
Definition: disinfect.py:4
CREMapInformation::setShopMin
void setShopMin(quint64 min)
Definition: CREMapInformation.cpp:253
CREMapInformation::animations
QStringList animations() const
Definition: CREMapInformation.cpp:115
CREMapInformation::addQuest
void addQuest(const QString &quest)
Definition: CREMapInformation.cpp:212
AssetWrapper
Definition: AssetWrapper.h:25
CREMapInformation::setShopRace
void setShopRace(const QString &race)
Definition: CREMapInformation.cpp:243
CREMapInformation::accessedFrom
QStringList accessedFrom() const
Definition: CREMapInformation.cpp:146
CREMapInformation::resetGroup
QString resetGroup
Definition: CREMapInformation.h:36
CREMapInformation::addFace
void addFace(const QString &face)
Definition: CREMapInformation.cpp:110
CREMapInformation::myShopMin
quint64 myShopMin
Definition: CREMapInformation.h:133
CREMapInformation::experience
qint64 experience
Definition: CREMapInformation.h:35
say.max
dictionary max
Definition: say.py:148
CREMapInformation::path
QString path
Definition: CREMapInformation.h:31
archetype
Definition: object.h:483
animate.anim
string anim
Definition: animate.py:20
CREMapInformation::shopMax
quint64 shopMax
Definition: CREMapInformation.h:41
CREMapInformation::quests
QStringList quests() const
Definition: CREMapInformation.cpp:207
CREMapInformation::computedDifficulty
int computedDifficulty
Definition: CREMapInformation.h:34
CREMapInformation::myComputedDifficulty
int myComputedDifficulty
Definition: CREMapInformation.h:125
CREMapInformation::myBackgroundMusic
QString myBackgroundMusic
Definition: CREMapInformation.h:135
CREMapInformation::addExitTo
void addExitTo(const QString &path)
Definition: CREMapInformation.cpp:140
region
Definition: map.h:272
diamondslots.message
string message
Definition: diamondslots.py:57
CREMapInformation::randomMaps
QList< RandomMap * > randomMaps() const
Definition: CREMapInformation.cpp:268
CREMapInformation::setBackgroundMusic
void setBackgroundMusic(const QString &music)
Definition: CREMapInformation.cpp:79
CREMapInformation::addRandomMap
void addRandomMap(RandomMap *map)
Definition: CREMapInformation.cpp:273
CREMapInformation::setMapTime
void setMapTime(const QDateTime &date)
Definition: CREMapInformation.cpp:130
CREMapInformation::setShopMax
void setShopMax(quint64 max)
Definition: CREMapInformation.cpp:263
CREMapInformation::backgroundMusic
QString backgroundMusic
Definition: CREMapInformation.h:37
CREMapInformation::setResetGroup
void setResetGroup(const QString &resetGroup)
Definition: CREMapInformation.cpp:89
std
Definition: json.hpp:4494
CREMapInformation::myExperience
qint64 myExperience
Definition: CREMapInformation.h:126
CREMapInformation::setName
void setName(const QString &name)
Definition: CREMapInformation.cpp:69
CREMapInformation::addArchetype
void addArchetype(const QString &archetype)
Definition: CREMapInformation.cpp:99
CREMapInformation::shopGreed
double shopGreed
Definition: CREMapInformation.h:38
CREMapInformation::faces
QStringList faces() const
Definition: CREMapInformation.cpp:105
CREMapInformation::myShopGreed
double myShopGreed
Definition: CREMapInformation.h:131
CREMapInformation::addAccessedFrom
void addAccessedFrom(const QString &path)
Definition: CREMapInformation.cpp:151
CREMapInformation::setExperience
void setExperience(qint64 experience)
Definition: CREMapInformation.cpp:182
CREMapInformation::myPath
QString myPath
Definition: CREMapInformation.h:116
CREMapInformation::myMapTime
QDateTime myMapTime
Definition: CREMapInformation.h:121
CREMapInformation::myRandomMaps
QList< RandomMap * > myRandomMaps
Definition: CREMapInformation.h:134
CREMapInformation::shopMin
quint64 shopMin
Definition: CREMapInformation.h:40
CREMapInformation::myRegion
QString myRegion
Definition: CREMapInformation.h:127