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 
37  public:
39  CREMapInformation(const QString& path);
40  virtual ~CREMapInformation();
41 
42  virtual QString displayName() const override;
43 
44  virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override;
45 
46  const QString& path() const;
47  void setPath(const QString& path);
48 
49  const QString& name() const;
50  void setName(const QString& name);
51 
52  const QString& backgroundMusic();
53  void setBackgroundMusic(const QString& music);
54 
55  QStringList archetypes() const;
56  void addArchetype(const QString& archetype);
57 
58  QStringList faces() const;
59  void addFace(const QString& face);
60 
61  QStringList animations() const;
62  void addAnimation(const QString& anim);
63 
64  const QDateTime& mapTime() const;
65  void setMapTime(const QDateTime& date);
66 
67  QStringList exitsTo() const;
68  void addExitTo(const QString& path);
69 
70  QStringList accessedFrom() const;
71  void addAccessedFrom(const QString& path);
72 
73  int difficulty() const;
74  void setDifficulty(int difficulty);
75 
76  int computedDifficulty() const;
77  void setComputedDifficulty(int computed);
78 
79  qint64 experience() const;
80  void setExperience(qint64 experience);
81 
82  const QString& region() const;
83  void setRegion(const QString& region);
84 
85  QStringList messages() const;
86  void addMessage(const QString& message);
87 
88  QStringList quests() const;
89  void addQuest(const QString& quest);
90 
91  QHash<QString, int>& shopItems();
92  const QHash<QString, int>& shopItems() const;
93 
94  double shopGreed() const;
95  void setShopGreed(double greed);
96  const QString& shopRace() const;
97  void setShopRace(const QString& race);
98  quint64 shopMin() const;
99  void setShopMin(quint64 min);
100  quint64 shopMax() const;
101  void setShopMax(quint64 max);
102 
103  QList<RandomMap*> randomMaps() const;
104  void addRandomMap(RandomMap* map);
105 
106  protected:
107  QString myPath;
108  QString myName;
109  QStringList myArchetypes;
110  QSet<QString> myFaces;
111  QSet<QString> myAnimations;
112  QDateTime myMapTime;
113  QStringList myExitsTo;
114  QStringList myAccessedFrom;
117  qint64 myExperience;
118  QString myRegion;
119  QStringList myMessages;
120  QStringList myQuests;
121  QHash<QString, int> myShopItems;
122  double myShopGreed;
123  QString myShopRace;
127 };
128 
129 #endif // CLASS_CRE_MAP_INFORMATION_H
RandomMap
Definition: RandomMap.h:26
CREMapInformation::setShopGreed
void setShopGreed(double greed)
Definition: CREMapInformation.cpp:223
CREMapInformation::myFaces
QSet< QString > myFaces
Definition: CREMapInformation.h:110
CREMapInformation::myQuests
QStringList myQuests
Definition: CREMapInformation.h:120
CREMapInformation::displayName
virtual QString displayName() const override
Definition: CREMapInformation.cpp:47
CREMapInformation::setComputedDifficulty
void setComputedDifficulty(int computed)
Definition: CREMapInformation.cpp:162
AssetWrapper.h
CREMapInformation::myAnimations
QSet< QString > myAnimations
Definition: CREMapInformation.h:111
CREMapInformation::uses
virtual PossibleUse uses(const AssetWrapper *asset, std::string &) const override
Definition: CREMapInformation.cpp:268
CREMapInformation::myDifficulty
int myDifficulty
Definition: CREMapInformation.h:115
CREMapInformation::difficulty
int difficulty
Definition: CREMapInformation.h:33
CREMapInformation::myName
QString myName
Definition: CREMapInformation.h:108
send.date
date
Definition: send.py:29
CREMapInformation::exitsTo
QStringList exitsTo() const
Definition: CREMapInformation.cpp:125
CREMapInformation::setPath
void setPath(const QString &path)
Definition: CREMapInformation.cpp:59
CREMapInformation::shopItems
QHash< QString, int > & shopItems()
Definition: CREMapInformation.cpp:208
AssetWrapper::PossibleUse
PossibleUse
Definition: AssetWrapper.h:28
CREMapInformation::shopRace
const QString & shopRace() const
Definition: CREMapInformation.cpp:228
CREMapInformation::archetypes
QStringList archetypes() const
Definition: CREMapInformation.cpp:84
CREMapInformation::myMessages
QStringList myMessages
Definition: CREMapInformation.h:119
CREMapInformation::myShopMax
quint64 myShopMax
Definition: CREMapInformation.h:124
CREMapInformation::myShopItems
QHash< QString, int > myShopItems
Definition: CREMapInformation.h:121
CREMapInformation::myAccessedFrom
QStringList myAccessedFrom
Definition: CREMapInformation.h:114
CREMapInformation::setDifficulty
void setDifficulty(int difficulty)
Definition: CREMapInformation.cpp:152
CREMapInformation::myExitsTo
QStringList myExitsTo
Definition: CREMapInformation.h:113
CREMapInformation::addAnimation
void addAnimation(const QString &anim)
Definition: CREMapInformation.cpp:110
CREMapInformation::addMessage
void addMessage(const QString &message)
Definition: CREMapInformation.cpp:191
CREMapInformation::name
QString name
Definition: CREMapInformation.h:32
CREMapInformation::shopGreed
double shopGreed() const
Definition: CREMapInformation.cpp:218
archt
Definition: object.h:469
CREMapInformation::messages
QStringList messages() const
Definition: CREMapInformation.cpp:186
CREMapInformation::myShopRace
QString myShopRace
Definition: CREMapInformation.h:123
CREMapInformation::backgroundMusic
const QString & backgroundMusic()
Definition: CREMapInformation.cpp:74
quest
Definition: quest.py:1
CREMapInformation
Definition: CREMapInformation.h:27
CREMapInformation::setRegion
void setRegion(const QString &region)
Definition: CREMapInformation.cpp:181
CREMapInformation::mapTime
const QDateTime & mapTime() const
Definition: CREMapInformation.cpp:115
CREMapInformation::myArchetypes
QStringList myArchetypes
Definition: CREMapInformation.h:109
disinfect.map
map
Definition: disinfect.py:4
CREMapInformation::setShopMin
void setShopMin(quint64 min)
Definition: CREMapInformation.cpp:243
CREMapInformation::animations
QStringList animations() const
Definition: CREMapInformation.cpp:105
CREMapInformation::addQuest
void addQuest(const QString &quest)
Definition: CREMapInformation.cpp:202
AssetWrapper
Definition: AssetWrapper.h:22
CREMapInformation::setShopRace
void setShopRace(const QString &race)
Definition: CREMapInformation.cpp:233
CREMapInformation::shopMin
quint64 shopMin() const
Definition: CREMapInformation.cpp:238
CREMapInformation::accessedFrom
QStringList accessedFrom() const
Definition: CREMapInformation.cpp:136
CREMapInformation::addFace
void addFace(const QString &face)
Definition: CREMapInformation.cpp:100
CREMapInformation::myShopMin
quint64 myShopMin
Definition: CREMapInformation.h:124
CREMapInformation::experience
qint64 experience
Definition: CREMapInformation.h:35
say.max
dictionary max
Definition: say.py:148
CREMapInformation::path
QString path
Definition: CREMapInformation.h:31
animate.anim
string anim
Definition: animate.py:20
CREMapInformation::quests
QStringList quests() const
Definition: CREMapInformation.cpp:197
CREMapInformation::computedDifficulty
int computedDifficulty
Definition: CREMapInformation.h:34
CREMapInformation::myComputedDifficulty
int myComputedDifficulty
Definition: CREMapInformation.h:116
CREMapInformation::myBackgroundMusic
QString myBackgroundMusic
Definition: CREMapInformation.h:126
CREMapInformation::addExitTo
void addExitTo(const QString &path)
Definition: CREMapInformation.cpp:130
diamondslots.message
string message
Definition: diamondslots.py:57
CREMapInformation::randomMaps
QList< RandomMap * > randomMaps() const
Definition: CREMapInformation.cpp:258
CREMapInformation::setBackgroundMusic
void setBackgroundMusic(const QString &music)
Definition: CREMapInformation.cpp:79
CREMapInformation::addRandomMap
void addRandomMap(RandomMap *map)
Definition: CREMapInformation.cpp:263
CREMapInformation::setMapTime
void setMapTime(const QDateTime &date)
Definition: CREMapInformation.cpp:120
CREMapInformation::setShopMax
void setShopMax(quint64 max)
Definition: CREMapInformation.cpp:253
std
Definition: json.hpp:4494
CREMapInformation::myExperience
qint64 myExperience
Definition: CREMapInformation.h:117
CREMapInformation::setName
void setName(const QString &name)
Definition: CREMapInformation.cpp:69
CREMapInformation::addArchetype
void addArchetype(const QString &archetype)
Definition: CREMapInformation.cpp:89
CREMapInformation::faces
QStringList faces() const
Definition: CREMapInformation.cpp:95
CREMapInformation::myShopGreed
double myShopGreed
Definition: CREMapInformation.h:122
CREMapInformation::addAccessedFrom
void addAccessedFrom(const QString &path)
Definition: CREMapInformation.cpp:141
CREMapInformation::setExperience
void setExperience(qint64 experience)
Definition: CREMapInformation.cpp:172
CREMapInformation::myPath
QString myPath
Definition: CREMapInformation.h:107
CREMapInformation::myMapTime
QDateTime myMapTime
Definition: CREMapInformation.h:112
CREMapInformation::myRandomMaps
QList< RandomMap * > myRandomMaps
Definition: CREMapInformation.h:125
CREMapInformation::myRegion
QString myRegion
Definition: CREMapInformation.h:118
CREMapInformation::shopMax
quint64 shopMax() const
Definition: CREMapInformation.cpp:248
regiondef
Definition: map.h:275