Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / ryzom / common / src / game_share / people_pd.cpp
blobcf5d4169017bd540bb86ab9dc5e204a38f717780
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2020 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #include "stdpch.h"
21 #include "people_pd.h"
23 namespace EGSPD
26 static const struct { const char* Name; CPeople::TPeople Value; } TPeopleConvert[] =
28 { "Humanoid", CPeople::Humanoid },
29 { "Playable", CPeople::Playable },
30 { "Fyros", CPeople::Fyros },
31 { "Matis", CPeople::Matis },
32 { "Tryker", CPeople::Tryker },
33 { "Zorai", CPeople::Zorai },
34 { "EndPlayable", CPeople::EndPlayable },
35 { "Karavan", CPeople::Karavan },
36 { "Tribe", CPeople::Tribe },
37 { "Common", CPeople::Common },
38 { "EndHumanoid", CPeople::EndHumanoid },
39 { "Creature", CPeople::Creature },
40 { "Fauna", CPeople::Fauna },
41 { "Arma", CPeople::Arma },
42 { "Balduse", CPeople::Balduse },
43 { "Bul", CPeople::Bul },
44 { "Capryni", CPeople::Capryni },
45 { "Chonari", CPeople::Chonari },
46 { "Clapclap", CPeople::Clapclap },
47 { "Cococlaw", CPeople::Cococlaw },
48 { "Cute", CPeople::Cute },
49 { "Dag", CPeople::Dag },
50 { "Diranak", CPeople::Diranak },
51 { "Estrasson", CPeople::Estrasson },
52 { "Filin", CPeople::Filin },
53 { "Frahar", CPeople::Frahar },
54 { "Gibbai", CPeople::Gibbai },
55 { "Hachtaha", CPeople::Hachtaha },
56 { "Jungler", CPeople::Jungler },
57 { "Kakty", CPeople::Kakty },
58 { "Kalab", CPeople::Kalab },
59 { "Kami", CPeople::Kami },
60 { "Kazoar", CPeople::Kazoar },
61 { "Kitin", CPeople::Kitin },
62 { "Kitins", CPeople::Kitins },
63 { "Kitifly", CPeople::Kitifly },
64 { "Kitihank", CPeople::Kitihank },
65 { "Kitiharak", CPeople::Kitiharak },
66 { "Kitikil", CPeople::Kitikil },
67 { "Kitimandib", CPeople::Kitimandib },
68 { "Kitinagan", CPeople::Kitinagan },
69 { "Kitinega", CPeople::Kitinega },
70 { "Kitinokto", CPeople::Kitinokto },
71 { "EndKitins", CPeople::EndKitins },
72 { "Lightbird", CPeople::Lightbird },
73 { "Mektoub", CPeople::Mektoub },
74 { "MektoubPacker", CPeople::MektoubPacker },
75 { "MektoubMount", CPeople::MektoubMount },
76 { "Pucetron", CPeople::Pucetron },
77 { "Regus", CPeople::Regus },
78 { "Ryzerb", CPeople::Ryzerb },
79 { "Ryzoholo", CPeople::Ryzoholo },
80 { "Ryzoholok", CPeople::Ryzoholok },
81 { "Vampignon", CPeople::Vampignon },
82 { "Varinx", CPeople::Varinx },
83 { "Yber", CPeople::Yber },
84 { "Zerx", CPeople::Zerx },
85 { "race_c1", CPeople::race_c1 },
86 { "race_c2", CPeople::race_c2 },
87 { "race_c3", CPeople::race_c3 },
88 { "race_c4", CPeople::race_c4 },
89 { "race_c5", CPeople::race_c5 },
90 { "race_c6", CPeople::race_c6 },
91 { "race_c7", CPeople::race_c7 },
92 { "race_h1", CPeople::race_h1 },
93 { "race_h2", CPeople::race_h2 },
94 { "race_h3", CPeople::race_h3 },
95 { "race_h4", CPeople::race_h4 },
96 { "race_h5", CPeople::race_h5 },
97 { "race_h6", CPeople::race_h6 },
98 { "race_h7", CPeople::race_h7 },
99 { "race_h8", CPeople::race_h8 },
100 { "race_h9", CPeople::race_h9 },
101 { "race_h10", CPeople::race_h10 },
102 { "race_h11", CPeople::race_h11 },
103 { "race_h12", CPeople::race_h12 },
104 { "EndFauna", CPeople::EndFauna },
105 { "Flora", CPeople::Flora },
106 { "Cephaloplant", CPeople::Cephaloplant },
107 { "Electroalgs", CPeople::Electroalgs },
108 { "Phytopsy", CPeople::Phytopsy },
109 { "SapEnslaver", CPeople::SapEnslaver },
110 { "SpittingWeeds", CPeople::SpittingWeeds },
111 { "Swarmplants", CPeople::Swarmplants },
112 { "EndFlora", CPeople::EndFlora },
113 { "Goo", CPeople::Goo },
114 { "GooFauna", CPeople::GooFauna },
115 { "GooArma", CPeople::GooArma },
116 { "GooBalduse", CPeople::GooBalduse },
117 { "GooBul", CPeople::GooBul },
118 { "GooCapryni", CPeople::GooCapryni },
119 { "GooChonari", CPeople::GooChonari },
120 { "GooClapclap", CPeople::GooClapclap },
121 { "GooCococlaw", CPeople::GooCococlaw },
122 { "GooCute", CPeople::GooCute },
123 { "GooDag", CPeople::GooDag },
124 { "GooDiranak", CPeople::GooDiranak },
125 { "GooEstrasson", CPeople::GooEstrasson },
126 { "GooFilin", CPeople::GooFilin },
127 { "GooFrahar", CPeople::GooFrahar },
128 { "GooGibbai", CPeople::GooGibbai },
129 { "GooHachtaha", CPeople::GooHachtaha },
130 { "GooJungler", CPeople::GooJungler },
131 { "GooKakty", CPeople::GooKakty },
132 { "GooKalab", CPeople::GooKalab },
133 { "GooKami", CPeople::GooKami },
134 { "GooKazoar", CPeople::GooKazoar },
135 { "GooKitifly", CPeople::GooKitifly },
136 { "GooKitihank", CPeople::GooKitihank },
137 { "GooKitiharak", CPeople::GooKitiharak },
138 { "GooKitikil", CPeople::GooKitikil },
139 { "GooKitimandib", CPeople::GooKitimandib },
140 { "GooKitin", CPeople::GooKitin },
141 { "GooKitinagan", CPeople::GooKitinagan },
142 { "GooKitinega", CPeople::GooKitinega },
143 { "GooKitinokto", CPeople::GooKitinokto },
144 { "GooLightbird", CPeople::GooLightbird },
145 { "GooMektoub", CPeople::GooMektoub },
146 { "GooMektoubPacker", CPeople::GooMektoubPacker },
147 { "GooMektoubMount", CPeople::GooMektoubMount },
148 { "GooPucetron", CPeople::GooPucetron },
149 { "GooRegus", CPeople::GooRegus },
150 { "GooRyzerb", CPeople::GooRyzerb },
151 { "GooRyzoholo", CPeople::GooRyzoholo },
152 { "GooRyzoholok", CPeople::GooRyzoholok },
153 { "GooVampignon", CPeople::GooVampignon },
154 { "GooVarinx", CPeople::GooVarinx },
155 { "GooYber", CPeople::GooYber },
156 { "GooZerx", CPeople::GooZerx },
157 { "Goorace_c1", CPeople::Goorace_c1 },
158 { "Goorace_c2", CPeople::Goorace_c2 },
159 { "Goorace_c3", CPeople::Goorace_c3 },
160 { "Goorace_c4", CPeople::Goorace_c4 },
161 { "Goorace_c5", CPeople::Goorace_c5 },
162 { "Goorace_c6", CPeople::Goorace_c6 },
163 { "Goorace_c7", CPeople::Goorace_c7 },
164 { "Goorace_h1", CPeople::Goorace_h1 },
165 { "Goorace_h2", CPeople::Goorace_h2 },
166 { "Goorace_h3", CPeople::Goorace_h3 },
167 { "Goorace_h4", CPeople::Goorace_h4 },
168 { "Goorace_h5", CPeople::Goorace_h5 },
169 { "Goorace_h6", CPeople::Goorace_h6 },
170 { "Goorace_h7", CPeople::Goorace_h7 },
171 { "Goorace_h8", CPeople::Goorace_h8 },
172 { "Goorace_h9", CPeople::Goorace_h9 },
173 { "Goorace_h10", CPeople::Goorace_h10 },
174 { "Goorace_h11", CPeople::Goorace_h11 },
175 { "Goorace_h12", CPeople::Goorace_h12 },
176 { "EndGooFauna", CPeople::EndGooFauna },
177 { "GooPlant", CPeople::GooPlant },
178 { "GooCephaloplant", CPeople::GooCephaloplant },
179 { "GooElectroalgs", CPeople::GooElectroalgs },
180 { "GooPhytopsy", CPeople::GooPhytopsy },
181 { "GooSapEnslaver", CPeople::GooSapEnslaver },
182 { "GooSpittingWeeds", CPeople::GooSpittingWeeds },
183 { "GooSwarmplants", CPeople::GooSwarmplants },
184 { "EndGooPlant", CPeople::EndGooPlant },
185 { "EndGoo", CPeople::EndGoo },
186 { "EndCreature", CPeople::EndCreature }
188 /* -----------------------------------------
189 * Static Implementation of CPeople
190 * ----------------------------------------- */
191 void CPeople::init()
193 _StrTable.clear();
194 _ValueMap.clear();
195 _StrTable.resize(142);
196 uint i;
197 for (i=0; i<159; ++i)
199 _StrTable[TPeopleConvert[i].Value] = TPeopleConvert[i].Name;
200 _ValueMap[NLMISC::toLowerAscii(std::string(TPeopleConvert[i].Name))] = TPeopleConvert[i].Value;
202 _Initialised = true;
204 bool CPeople::_Initialised = false;
205 std::string CPeople::_UnknownString = "Unknown";
206 std::vector<std::string> CPeople::_StrTable;
207 std::map<std::string, CPeople::TPeople> CPeople::_ValueMap;
208 // End of static implementation of CPeople
210 static const struct { const char* Name; CClassificationType::TClassificationType Value; } TClassificationTypeConvert[] =
212 { "TypeHumanoid", CClassificationType::TypeHumanoid },
213 { "TypeHomin", CClassificationType::TypeHomin },
214 { "TypeDegenerated", CClassificationType::TypeDegenerated },
215 { "TypeFauna", CClassificationType::TypeFauna },
216 { "TypeFlora", CClassificationType::TypeFlora },
217 { "TypeDog", CClassificationType::TypeDog },
218 { "TypeRunner", CClassificationType::TypeRunner },
219 { "TypeHorse", CClassificationType::TypeHorse },
220 { "TypeBird", CClassificationType::TypeBird },
221 { "TypeKitin", CClassificationType::TypeKitin },
222 { "TypeLandKitin", CClassificationType::TypeLandKitin },
223 { "TypeFlyingKitin", CClassificationType::TypeFlyingKitin },
224 { "TypeFish", CClassificationType::TypeFish },
225 { "TypeRyzomian", CClassificationType::TypeRyzomian },
226 { "TypeGreatRyzomian", CClassificationType::TypeGreatRyzomian },
227 { "TypePachyderm", CClassificationType::TypePachyderm },
228 { "TypeShellfish", CClassificationType::TypeShellfish },
229 { "TypeKami", CClassificationType::TypeKami },
230 { "TypeKaravan", CClassificationType::TypeKaravan },
231 { "TypeAll", CClassificationType::TypeAll },
233 /* -----------------------------------------
234 * Static Implementation of CClassificationType
235 * ----------------------------------------- */
236 void CClassificationType::init()
238 _StrTable.clear();
239 _ValueMap.clear();
240 _StrTable.resize(20);
241 uint i;
242 for (i=0; i<20; ++i)
244 _StrTable[TClassificationTypeConvert[i].Value] = TClassificationTypeConvert[i].Name;
245 _ValueMap[NLMISC::toLowerAscii(std::string(TClassificationTypeConvert[i].Name))] = TClassificationTypeConvert[i].Value;
247 _Initialised = true;
249 bool CClassificationType::_Initialised = false;
250 std::string CClassificationType::_UnknownString = "Unknown";
251 std::vector<std::string> CClassificationType::_StrTable;
252 std::map<std::string, CClassificationType::TClassificationType> CClassificationType::_ValueMap;
253 // End of static implementation of CClassificationType
256 } // End of EGSPD