Crossfire Server, Trunk  R20513
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 {
25  clone->copy(*this);
26  return clone;
27 }
28 
30 {
31  setPath(other.path());
32  setName(other.name());
33  myArchetypes.append(other.archetypes());
34  setMapTime(other.mapTime());
35  myExitsTo.append(other.exitsTo());
36  myAccessedFrom.append(other.accessedFrom());
37  setLevel(other.level());
38  setExperience(other.experience());
39  setRegion(other.region());
40  myShopItems = other.shopItems();
41  myShopGreed = other.shopGreed();
42  myShopRace = other.shopRace();
43  myShopMin = other.shopMin();
44  myShopMax = other.shopMax();
46 }
47 
48 const QString& CREMapInformation::displayName() const
49 {
50  if (myName.isEmpty())
51  return myPath;
52  return myName;
53 }
54 
55 const QString& CREMapInformation::path() const
56 {
57  return myPath;
58 }
59 
60 void CREMapInformation::setPath(const QString& path)
61 {
62  myPath = path;
63 }
64 
65 const QString& CREMapInformation::name() const
66 {
67  return myName;
68 }
69 
70 void CREMapInformation::setName(const QString& name)
71 {
72  myName = name;
73 }
74 
75 QStringList CREMapInformation::archetypes() const
76 {
77  return myArchetypes;
78 }
79 
81 {
82  if (!myArchetypes.contains(archetype))
83  myArchetypes.append(archetype);
84 }
85 
86 const QDateTime& CREMapInformation::mapTime() const
87 {
88  return myMapTime;
89 }
90 
91 void CREMapInformation::setMapTime(const QDateTime& date)
92 {
93  myMapTime = date;
94 }
95 
96 QStringList CREMapInformation::exitsTo() const
97 {
98  return myExitsTo;
99 }
100 
101 void CREMapInformation::addExitTo(const QString& path)
102 {
103  if (!myExitsTo.contains(path))
104  myExitsTo.append(path);
105 }
106 
108 {
109  return myAccessedFrom;
110 }
111 
113 {
114  if (!myAccessedFrom.contains(path))
115  myAccessedFrom.append(path);
116 }
117 
118 int CREMapInformation::level() const
119 {
120  return myLevel;
121 }
122 
124 {
125  myLevel = level;
126 }
127 
128 qint64 CREMapInformation::experience() const
129 {
130  return myExperience;
131 }
132 
134 {
136 }
137 
138 const QString& CREMapInformation::region() const
139 {
140  return myRegion;
141 }
143 {
144  myRegion = region;
145 }
146 
147 QStringList CREMapInformation::messages() const
148 {
149  return myMessages;
150 }
151 
152 void CREMapInformation::addMessage(const QString& message)
153 {
154  if (!myMessages.contains(message))
155  myMessages.append(message);
156 }
157 
158 QStringList CREMapInformation::quests() const
159 {
160  return myQuests;
161 }
162 
163 void CREMapInformation::addQuest(const QString& quest)
164 {
165  if (!myQuests.contains(quest))
166  myQuests.append(quest);
167 }
168 
169 QHash<QString, int>& CREMapInformation::shopItems()
170 {
171  return myShopItems;
172 }
173 
174 const QHash<QString, int>& CREMapInformation::shopItems() const
175 {
176  return myShopItems;
177 }
178 
180 {
181  return myShopGreed;
182 }
183 
185 {
186  myShopGreed = greed;
187 }
188 
189 const QString& CREMapInformation::shopRace() const
190 {
191  return myShopRace;
192 }
193 
194 void CREMapInformation::setShopRace(const QString& race)
195 {
196  myShopRace = race;
197 }
198 
200 {
201  return myShopMin;
202 }
203 
205 {
206  myShopMin = min;
207 }
208 
210 {
211  return myShopMax;
212 }
213 
215 {
216  myShopMax = max;
217 }
218 
219 QList<CRERandomMap*> CREMapInformation::randomMaps() const
220 {
221  return myRandomMaps;
222 }
223 
225 {
226  myRandomMaps.append(map);
227 }
QStringList exitsTo() const
QStringList myMessages
int level() const
QStringList myAccessedFrom
QStringList myArchetypes
qint64 experience() const
QHash< QString, int > myShopItems
const QString & name() const
void setPath(const QString &path)
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:465
const QString & displayName() const
void copy(const CREMapInformation &other)
void addMessage(const QString &message)
QList< CRERandomMap * > randomMaps() const
void setShopRace(const QString &race)
void addQuest(const QString &quest)
QStringList messages() const
void setShopMin(quint64 min)
QStringList archetypes() const
double shopGreed() const
This is a game region.
Definition: map.h:276
void setRegion(const QString &region)
void addRandomMap(CRERandomMap *map)
const QString & shopRace() const
void setName(const QString &name)
QStringList accessedFrom() const
void setShopMax(quint64 max)
const QString & path() const
void addAccessedFrom(const QString &path)
CREMapInformation * clone() const
void setMapTime(const QDateTime &date)
void addExitTo(const QString &path)
const QString & region() const
quint64 shopMin() const
void setExperience(qint64 experience)
quint64 shopMax() const
void addArchetype(const QString &archetype)
void setLevel(int level)
QList< CRERandomMap * > myRandomMaps
const QDateTime & mapTime() const
void setShopGreed(double greed)
QStringList quests() const
QHash< QString, int > & shopItems()