1use crate::packet::header::Header;
7use derive_new::new;
8use getset::{CopyGetters, Getters};
9
10#[derive(Debug, PartialEq, Copy, Clone, Eq, Ord, PartialOrd, Hash)]
14pub enum Controller {
15 AI,
16 Human,
17}
18
19impl Default for Controller {
20 fn default() -> Self {
21 Controller::AI
22 }
23}
24
25#[derive(Debug, PartialEq, Copy, Clone, Eq, Ord, PartialOrd, Hash)]
31pub enum Driver {
32 AlainForest,
33 AlessioLorandi,
34 AlexMurray,
35 AlexanderAlbon,
36 AnthoineHubert,
37 AntonioFuoco,
38 AntonioGiovinazzi,
39 ArjunMaini,
40 ArronBarnes,
41 ArtemMarkelov,
42 BenjaminCoppens,
43 CallistoCalabresi,
44 CallumIlott,
45 CarlosSainz,
46 CharlesLeclerc,
47 DanielJones,
48 DanielRicciardo,
49 DaniilKvyat,
50 DorianBoccolacci,
51 EstoSaari,
52 FlavioNieves,
53 GeorgeRussell,
54 GertWaldmuller,
55 GuanyaZhou,
56 GuilianoAlesi,
57 HowardClarke,
58 IgorCorreia,
59 JackAitken,
60 JackTremblay,
61 JayLetourneau,
62 JonasSchiffer,
63 JordanKing,
64 JuanManuelCorrea,
65 JulianQuesada,
66 KevinMagnussen,
67 KimiRaikkonen,
68 KlimekMichalski,
69 LanceStroll,
70 LandoNorris,
71 LewisHamilton,
72 LouisDeletraz,
73 LucaGhiotto,
74 LucasRoth,
75 MahaveerRaghunathan,
76 MarieLaursen,
77 MartinGiles,
78 MaxVerstappen,
79 MaximilianGunther,
80 MickSchumacher,
81 NaotaIzum,
82 NicholasLatifi,
83 NicoHulkenburg,
84 NikitaMazepin,
85 NikoKari,
86 NireiFukuzumi,
87 NoahVisser,
88 NobuharuMatsushita,
89 NyckDeVries,
90 PeterBelousov,
91 PierreGasly,
92 RalphBoschung,
93 RashidNair,
94 RobertKubica,
95 RobertoMerhi,
96 RomainGrosjean,
97 RubenMeijer,
98 SantiagoMoreno,
99 SeanGelael,
100 SebastianVettel,
101 SergioPerez,
102 SergioSetteCamara,
103 SophieLevasseur,
104 TadasukeMakino,
105 TatianaCalderon,
106 ValtteriBottas,
107 WilheimKaufmann,
108 YasarAtiyeh,
109}
110
111impl Default for Driver {
112 fn default() -> Self {
113 Driver::NicoHulkenburg
115 }
116}
117
118#[derive(Debug, PartialEq, Copy, Clone, Eq, Ord, PartialOrd, Hash)]
123pub enum Team {
124 ARTGrandPrix,
125 AlfaRomeo,
126 Arden2019,
127 ArtGP2019,
128 BWTArden,
129 Brawn2009,
130 Campos2019,
131 CamposVexatecRacing,
132 Carlin,
133 Carlin2019,
134 CharouzRacingSystem,
135 DAMS,
136 Dams2019,
137 Ferrari,
138 Ferrari1976,
139 Ferrari1979,
140 Ferrari1990,
141 Ferrari1995,
142 Ferrari2002,
143 Ferrari2004,
144 Ferrari2007,
145 Ferrari2010,
146 Haas,
147 Lotus1972,
148 Lotus1978,
149 MPMotorsport,
150 MPMotorsport2019,
151 McLaren,
152 McLaren1976,
153 McLaren1982,
154 McLaren1988,
155 McLaren1990,
156 McLaren1991,
157 McLaren1998,
158 McLaren2010,
159 Mercedes,
160 Pertamina,
161 Prema2019,
162 RacingPoint,
163 RedBull2010,
164 RedBullRacing,
165 Renault,
166 Renault2006,
167 RussianTime,
168 SauberJuniorCharouz2019,
169 ToroRosso,
170 Trident,
171 Trident2019,
172 UniVirtuosi2019,
173 Williams,
174 Williams1992,
175 Williams1996,
176 Williams2003,
177}
178
179impl Default for Team {
180 fn default() -> Self {
181 Team::Mercedes
183 }
184}
185
186#[derive(Debug, PartialEq, Copy, Clone, Eq, Ord, PartialOrd, Hash)]
191pub enum Nationality {
192 American,
193 Argentinean,
194 Australian,
195 Austrian,
196 Azerbaijani,
197 Bahraini,
198 Belgian,
199 Bolivian,
200 Brazilian,
201 British,
202 Bulgarian,
203 Cameroonian,
204 Canadian,
205 Chilean,
206 Chinese,
207 Colombian,
208 CostaRican,
209 Croatian,
210 Cypriot,
211 Czech,
212 Danish,
213 Dutch,
214 Ecuadorian,
215 Emirian,
216 English,
217 Estonian,
218 Finnish,
219 French,
220 German,
221 Ghanaian,
222 Greek,
223 Guatemalan,
224 Honduran,
225 HongKonger,
226 Hungarian,
227 Icelander,
228 Indian,
229 Indonesian,
230 Irish,
231 Israeli,
232 Italian,
233 Jamaican,
234 Japanese,
235 Jordanian,
236 Kuwaiti,
237 Latvian,
238 Lebanese,
239 Lithuanian,
240 Luxembourger,
241 Malaysian,
242 Maltese,
243 Mexican,
244 Monegasque,
245 NewZealander,
246 Nicaraguan,
247 NorthKorean,
248 NorthernIrish,
249 Norwegian,
250 Omani,
251 Pakistani,
252 Panamanian,
253 Paraguayan,
254 Peruvian,
255 Polish,
256 Portuguese,
257 Qatari,
258 Romanian,
259 Russian,
260 Salvadoran,
261 Saudi,
262 Scottish,
263 Serbian,
264 Singaporean,
265 Slovakian,
266 Slovenian,
267 SouthAfrican,
268 SouthKorean,
269 Spanish,
270 Swedish,
271 Swiss,
272 Thai,
273 Turkish,
274 Ukrainian,
275 Uruguayan,
276 Venezuelan,
277 Welsh,
278}
279
280impl Default for Nationality {
281 fn default() -> Self {
282 Nationality::German
284 }
285}
286
287#[derive(Debug, PartialEq, Copy, Clone, Eq, Ord, PartialOrd, Hash)]
292pub enum TelemetryPrivacy {
293 Public,
294 Restricted,
295}
296
297impl Default for TelemetryPrivacy {
298 fn default() -> Self {
299 TelemetryPrivacy::Public
300 }
301}
302
303#[derive(
308 new, Debug, CopyGetters, Getters, PartialEq, Clone, Eq, Ord, PartialOrd, Hash, Default,
309)]
310pub struct Participant {
311 #[getset(get_copy = "pub")]
313 controller: Controller,
314
315 #[getset(get_copy = "pub")]
317 driver: Driver,
318
319 #[getset(get_copy = "pub")]
321 team: Team,
322
323 #[getset(get_copy = "pub")]
325 race_number: u8,
326
327 #[getset(get_copy = "pub")]
329 nationality: Nationality,
330
331 #[getset(get = "pub")]
337 name: String,
338
339 #[getset(get_copy = "pub")]
341 telemetry_privacy: Option<TelemetryPrivacy>,
342}
343
344#[derive(new, Debug, CopyGetters, Getters, PartialEq, Clone, Eq, Ord, PartialOrd, Hash)]
349pub struct ParticipantsPacket {
350 #[getset(get = "pub")]
352 header: Header,
353
354 #[getset(get_copy = "pub")]
359 active_participants_count: u8,
360
361 #[getset(get = "pub")]
366 participants: Vec<Participant>,
367}