Crossfire Server, Trunk  R21219
CREMapInformation.cpp
Go to the documentation of this file.
1 #include "CREMapInformation.h"
2 
4 {
5  myLevel = 0;
6  myExperience = 0;
7  myShopGreed = 0;
8  myShopMin = 0;
9  myShopMax = 0;
10 }
11 
13 {
14  myPath = path;
15  myLevel = 0;
16  myExperience = 0;
17  myShopGreed = 0;
18  myShopMin = 0;
19  myShopMax = 0;
20 }
21 
23 {
24  qDeleteAll(myRandomMaps);
25 }
26 
28 {
30  clone->copy(*this);
31  return clone;
32 }
33 
35 {
36  setPath(other.path());
37  setName(other.name());
38  myArchetypes.append(other.archetypes());
39  setMapTime(other.mapTime());
40  myExitsTo.append(other.exitsTo());
41  myAccessedFrom.append(other.accessedFrom());
42  setLevel(other.level());
43  setExperience(other.experience());
44  setRegion(other.region());
45  myShopItems = other.shopItems();
46  myShopGreed = other.shopGreed();
47  myShopRace = other.shopRace();
48  myShopMin = other.shopMin();
49  myShopMax = other.shopMax();
51 }
52 
53 const QString& CREMapInformation::displayName() const
54 {
55  if (myName.isEmpty())
56  return myPath;
57  return myName;
58 }
59 
60 const QString& CREMapInformation::path() const
61 {
62  return myPath;
63 }
64 
65 void CREMapInformation::setPath(const QString& path)
66 {
67  myPath = path;
68 }
69 
70 const QString& CREMapInformation::name() const
71 {
72  return myName;
73 }
74 
75 void CREMapInformation::setName(const QString& name)
76 {
77  myName = name;
78 }
79 
81 {
82  return myBackgroundMusic;
83 }
84 
85 void CREMapInformation::setBackgroundMusic(const QString& music)
86 {
87  myBackgroundMusic = music;
88 }
89 
90 QStringList CREMapInformation::archetypes() const
91 {
92  return myArchetypes;
93 }
94 
96 {
97  if (!myArchetypes.contains(archetype))
98  myArchetypes.append(archetype);
99 }
100 
101 const QDateTime& CREMapInformation::mapTime() const
102 {
103  return myMapTime;
104 }
105 
106 void CREMapInformation::setMapTime(const QDateTime& date)
107 {
108  myMapTime = date;
109 }
110 
111 QStringList CREMapInformation::exitsTo() const
112 {
113  return myExitsTo;
114 }
115 
116 void CREMapInformation::addExitTo(const QString& path)
117 {
118  if (!myExitsTo.contains(path))
119  myExitsTo.append(path);
120 }
121 
123 {
124  return myAccessedFrom;
125 }
126 
128 {
129  if (!myAccessedFrom.contains(path))
130  myAccessedFrom.append(path);
131 }
132 
133 int CREMapInformation::level() const
134 {
135  return myLevel;
136 }
137 
139 {
140  myLevel = level;
141 }
142 
143 qint64 CREMapInformation::experience() const
144 {
145  return myExperience;
146 }
147 
149 {
151 }
152 
153 const QString& CREMapInformation::region() const
154 {
155  return myRegion;
156 }
158 {
159  myRegion = region;
160 }
161 
162 QStringList CREMapInformation::messages() const
163 {
164  return myMessages;
165 }
166 
167 void CREMapInformation::addMessage(const QString& message)
168 {
169  if (!myMessages.contains(message))
170  myMessages.append(message);
171 }
172 
173 QStringList CREMapInformation::quests() const
174 {
175  return myQuests;
176 }
177 
178 void CREMapInformation::addQuest(const QString& quest)
179 {
180  if (!myQuests.contains(quest))
181  myQuests.append(quest);
182 }
183 
184 QHash<QString, int>& CREMapInformation::shopItems()
185 {
186  return myShopItems;
187 }
188 
189 const QHash<QString, int>& CREMapInformation::shopItems() const
190 {
191  return myShopItems;
192 }
193 
195 {
196  return myShopGreed;
197 }
198 
200 {
201  myShopGreed = greed;
202 }
203 
204 const QString& CREMapInformation::shopRace() const
205 {
206  return myShopRace;
207 }
208 
209 void CREMapInformation::setShopRace(const QString& race)
210 {
211  myShopRace = race;
212 }
213 
215 {
216  return myShopMin;
217 }
218 
220 {
221  myShopMin = min;
222 }
223 
225 {
226  return myShopMax;
227 }
228 
230 {
231  myShopMax = max;
232 }
233 
234 QList<CRERandomMap*> CREMapInformation::randomMaps() const
235 {
236  return myRandomMaps;
237 }
238 
240 {
241  myRandomMaps.append(map);
242 }
QStringList myMessages
quint64 shopMax() const
QStringList myAccessedFrom
QList< CRERandomMap * > randomMaps() const
const QString & name() const
int level() const
double shopGreed() const
const QString & backgroundMusic()
QStringList exitsTo() const
QStringList myArchetypes
CREMapInformation * clone() const
const QString & shopRace() const
QStringList archetypes() const
QHash< QString, int > myShopItems
qint64 experience() const
void setPath(const QString &path)
Definition: object.h:465
void copy(const CREMapInformation &other)
quint64 shopMin() const
void addMessage(const QString &message)
void setShopRace(const QString &race)
void addQuest(const QString &quest)
void setShopMin(quint64 min)
QStringList quests() const
const QString & path() const
Definition: map.h:276
QStringList messages() const
void setRegion(const QString &region)
void addRandomMap(CRERandomMap *map)
const QDateTime & mapTime() const
QStringList accessedFrom() const
void setName(const QString &name)
void setShopMax(quint64 max)
void addAccessedFrom(const QString &path)
void setMapTime(const QDateTime &date)
void addExitTo(const QString &path)
const QString & displayName() const
void setBackgroundMusic(const QString &music)
void setExperience(qint64 experience)
void addArchetype(const QString &archetype)
void setLevel(int level)
QList< CRERandomMap * > myRandomMaps
void setShopGreed(double greed)
const QString & region() const
QHash< QString, int > & shopItems()