1use super::class_requires::*;
2use super::*;
3#[allow(non_upper_case_globals, non_snake_case)]
10#[cfg_attr(feature = "json_schema", derive(schemars::JsonSchema))]
11#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12#[derive(educe::Educe)]
13#[educe(Debug, Clone, Default, PartialEq)]
14pub struct hkpTyremarksWheel {
15 #[cfg_attr(
22 feature = "serde",
23 serde(skip_serializing_if = "Option::is_none", default)
24 )]
25 pub __ptr: Option<Pointer>,
26 #[cfg_attr(feature = "json_schema", schemars(flatten))]
28 #[cfg_attr(feature = "serde", serde(flatten))]
29 pub parent: hkReferencedObject,
30 #[cfg_attr(feature = "json_schema", schemars(rename = "currentPosition"))]
35 #[cfg_attr(feature = "serde", serde(rename = "currentPosition"))]
36 pub m_currentPosition: i32,
37 #[cfg_attr(feature = "json_schema", schemars(rename = "numPoints"))]
42 #[cfg_attr(feature = "serde", serde(rename = "numPoints"))]
43 pub m_numPoints: i32,
44 #[cfg_attr(feature = "json_schema", schemars(rename = "tyremarkPoints"))]
49 #[cfg_attr(feature = "serde", serde(rename = "tyremarkPoints"))]
50 pub m_tyremarkPoints: Vec<hkpTyremarkPoint>,
51}
52const _: () = {
53 use havok_serde as _serde;
54 impl _serde::HavokClass for hkpTyremarksWheel {
55 #[inline]
56 fn name(&self) -> &'static str {
57 "hkpTyremarksWheel"
58 }
59 #[inline]
60 fn signature(&self) -> _serde::__private::Signature {
61 _serde::__private::Signature::new(0x1eaef041)
62 }
63 #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
64 fn deps_indexes(&self) -> Vec<usize> {
65 let mut v = Vec::new();
66 v.extend(
67 self
68 .m_tyremarkPoints
69 .iter()
70 .flat_map(|class| class.deps_indexes())
71 .collect::<Vec<usize>>(),
72 );
73 v
74 }
75 }
76 impl _serde::Serialize for hkpTyremarksWheel {
77 fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
78 where
79 S: _serde::ser::Serializer,
80 {
81 let class_meta = self
82 .__ptr
83 .map(|name| (name, _serde::__private::Signature::new(0x1eaef041)));
84 let mut serializer = __serializer
85 .serialize_struct("hkpTyremarksWheel", class_meta, (28u64, 40u64))?;
86 serializer.pad_field([0u8; 4usize].as_slice(), [0u8; 8usize].as_slice())?;
87 serializer.skip_field("memSizeAndFlags", &self.parent.m_memSizeAndFlags)?;
88 serializer.skip_field("referenceCount", &self.parent.m_referenceCount)?;
89 serializer.pad_field([0u8; 0usize].as_slice(), [0u8; 4usize].as_slice())?;
90 serializer.serialize_field("currentPosition", &self.m_currentPosition)?;
91 serializer.serialize_field("numPoints", &self.m_numPoints)?;
92 serializer
93 .serialize_array_field(
94 "tyremarkPoints",
95 &self.m_tyremarkPoints,
96 TypeSize::Struct {
97 size_x86: 32u64,
98 size_x86_64: 32u64,
99 },
100 )?;
101 serializer.end()
102 }
103 }
104};
105#[doc(hidden)]
106#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
107const _: () = {
108 use havok_serde as _serde;
109 #[automatically_derived]
110 impl<'de> _serde::Deserialize<'de> for hkpTyremarksWheel {
111 fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
112 where
113 __D: _serde::Deserializer<'de>,
114 {
115 #[allow(non_camel_case_types)]
116 enum __Field {
117 m_currentPosition,
118 m_numPoints,
119 m_tyremarkPoints,
120 __ignore,
121 }
122 struct __FieldVisitor;
123 impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
124 type Value = __Field;
125 fn expecting(
126 &self,
127 __formatter: &mut core::fmt::Formatter,
128 ) -> core::fmt::Result {
129 core::fmt::Formatter::write_str(__formatter, "field identifier")
130 }
131 #[allow(clippy::match_single_binding)]
133 #[allow(clippy::reversed_empty_ranges)]
134 #[allow(clippy::single_match)]
135 fn visit_key<__E>(
136 self,
137 __value: &str,
138 ) -> core::result::Result<Self::Value, __E>
139 where
140 __E: _serde::de::Error,
141 {
142 match __value {
143 "currentPosition" => Ok(__Field::m_currentPosition),
144 "numPoints" => Ok(__Field::m_numPoints),
145 "tyremarkPoints" => Ok(__Field::m_tyremarkPoints),
146 _ => Ok(__Field::__ignore),
147 }
148 }
149 }
150 impl<'de> _serde::Deserialize<'de> for __Field {
151 #[inline]
152 fn deserialize<__D>(
153 __deserializer: __D,
154 ) -> core::result::Result<Self, __D::Error>
155 where
156 __D: _serde::Deserializer<'de>,
157 {
158 _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
159 }
160 }
161 struct __hkpTyremarksWheelVisitor<'de> {
162 marker: _serde::__private::PhantomData<hkpTyremarksWheel>,
163 lifetime: _serde::__private::PhantomData<&'de ()>,
164 }
165 #[allow(clippy::match_single_binding)]
166 #[allow(clippy::reversed_empty_ranges)]
167 #[allow(clippy::single_match)]
168 impl<'de> _serde::de::Visitor<'de> for __hkpTyremarksWheelVisitor<'de> {
169 type Value = hkpTyremarksWheel;
170 fn expecting(
171 &self,
172 __formatter: &mut core::fmt::Formatter,
173 ) -> core::fmt::Result {
174 core::fmt::Formatter::write_str(
175 __formatter,
176 "struct hkpTyremarksWheel",
177 )
178 }
179 fn visit_struct_for_bytes<__A>(
180 self,
181 mut __map: __A,
182 ) -> _serde::__private::Result<Self::Value, __A::Error>
183 where
184 __A: _serde::de::MapAccess<'de>,
185 {
186 let __ptr = __A::class_ptr(&mut __map);
187 let parent = __A::parent_value(&mut __map)?;
188 let mut m_currentPosition: _serde::__private::Option<i32> = _serde::__private::None;
189 let mut m_numPoints: _serde::__private::Option<i32> = _serde::__private::None;
190 let mut m_tyremarkPoints: _serde::__private::Option<
191 Vec<hkpTyremarkPoint>,
192 > = _serde::__private::None;
193 for i in 0..3usize {
194 match i {
195 0usize => {
196 if _serde::__private::Option::is_some(&m_currentPosition) {
197 return _serde::__private::Err(
198 <__A::Error as _serde::de::Error>::duplicate_field(
199 "currentPosition",
200 ),
201 );
202 }
203 m_currentPosition = _serde::__private::Some(
204 match __A::next_value::<i32>(&mut __map) {
205 _serde::__private::Ok(__val) => __val,
206 _serde::__private::Err(__err) => {
207 return _serde::__private::Err(__err);
208 }
209 },
210 );
211 }
212 1usize => {
213 if _serde::__private::Option::is_some(&m_numPoints) {
214 return _serde::__private::Err(
215 <__A::Error as _serde::de::Error>::duplicate_field(
216 "numPoints",
217 ),
218 );
219 }
220 m_numPoints = _serde::__private::Some(
221 match __A::next_value::<i32>(&mut __map) {
222 _serde::__private::Ok(__val) => __val,
223 _serde::__private::Err(__err) => {
224 return _serde::__private::Err(__err);
225 }
226 },
227 );
228 }
229 2usize => {
230 if _serde::__private::Option::is_some(&m_tyremarkPoints) {
231 return _serde::__private::Err(
232 <__A::Error as _serde::de::Error>::duplicate_field(
233 "tyremarkPoints",
234 ),
235 );
236 }
237 m_tyremarkPoints = _serde::__private::Some(
238 match __A::next_value::<Vec<hkpTyremarkPoint>>(&mut __map) {
239 _serde::__private::Ok(__val) => __val,
240 _serde::__private::Err(__err) => {
241 return _serde::__private::Err(__err);
242 }
243 },
244 );
245 }
246 _ => {}
247 }
248 }
249 let m_currentPosition = match m_currentPosition {
250 _serde::__private::Some(__field) => __field,
251 _serde::__private::None => {
252 return _serde::__private::Err(
253 <__A::Error as _serde::de::Error>::missing_field(
254 "currentPosition",
255 ),
256 );
257 }
258 };
259 let m_numPoints = match m_numPoints {
260 _serde::__private::Some(__field) => __field,
261 _serde::__private::None => {
262 return _serde::__private::Err(
263 <__A::Error as _serde::de::Error>::missing_field(
264 "numPoints",
265 ),
266 );
267 }
268 };
269 let m_tyremarkPoints = match m_tyremarkPoints {
270 _serde::__private::Some(__field) => __field,
271 _serde::__private::None => {
272 return _serde::__private::Err(
273 <__A::Error as _serde::de::Error>::missing_field(
274 "tyremarkPoints",
275 ),
276 );
277 }
278 };
279 _serde::__private::Ok(hkpTyremarksWheel {
280 __ptr,
281 parent,
282 m_currentPosition,
283 m_numPoints,
284 m_tyremarkPoints,
285 })
286 }
287 #[allow(clippy::manual_unwrap_or_default)]
288 fn visit_struct<__A>(
289 self,
290 mut __map: __A,
291 ) -> _serde::__private::Result<Self::Value, __A::Error>
292 where
293 __A: _serde::de::MapAccess<'de>,
294 {
295 let mut m_currentPosition: _serde::__private::Option<i32> = _serde::__private::None;
296 let mut m_numPoints: _serde::__private::Option<i32> = _serde::__private::None;
297 let mut m_tyremarkPoints: _serde::__private::Option<
298 Vec<hkpTyremarkPoint>,
299 > = _serde::__private::None;
300 while let _serde::__private::Some(__key) = {
301 __A::next_key::<__Field>(&mut __map)?
302 } {
303 match __key {
304 __Field::m_currentPosition => {
305 #[cfg(
306 any(feature = "strict", feature = "ignore_duplicates")
307 )]
308 if _serde::__private::Option::is_some(&m_currentPosition) {
309 #[cfg(feature = "ignore_duplicates")]
310 {
311 __A::skip_value(&mut __map)?;
312 continue;
313 }
314 #[cfg(feature = "strict")]
315 return _serde::__private::Err(
316 <__A::Error as _serde::de::Error>::duplicate_field(
317 "currentPosition",
318 ),
319 );
320 }
321 m_currentPosition = _serde::__private::Some(
322 match __A::next_value::<i32>(&mut __map) {
323 _serde::__private::Ok(__val) => __val,
324 _serde::__private::Err(__err) => {
325 return _serde::__private::Err(__err);
326 }
327 },
328 );
329 }
330 __Field::m_numPoints => {
331 #[cfg(
332 any(feature = "strict", feature = "ignore_duplicates")
333 )]
334 if _serde::__private::Option::is_some(&m_numPoints) {
335 #[cfg(feature = "ignore_duplicates")]
336 {
337 __A::skip_value(&mut __map)?;
338 continue;
339 }
340 #[cfg(feature = "strict")]
341 return _serde::__private::Err(
342 <__A::Error as _serde::de::Error>::duplicate_field(
343 "numPoints",
344 ),
345 );
346 }
347 m_numPoints = _serde::__private::Some(
348 match __A::next_value::<i32>(&mut __map) {
349 _serde::__private::Ok(__val) => __val,
350 _serde::__private::Err(__err) => {
351 return _serde::__private::Err(__err);
352 }
353 },
354 );
355 }
356 __Field::m_tyremarkPoints => {
357 #[cfg(
358 any(feature = "strict", feature = "ignore_duplicates")
359 )]
360 if _serde::__private::Option::is_some(&m_tyremarkPoints) {
361 #[cfg(feature = "ignore_duplicates")]
362 {
363 __A::skip_value(&mut __map)?;
364 continue;
365 }
366 #[cfg(feature = "strict")]
367 return _serde::__private::Err(
368 <__A::Error as _serde::de::Error>::duplicate_field(
369 "tyremarkPoints",
370 ),
371 );
372 }
373 m_tyremarkPoints = _serde::__private::Some(
374 match __A::next_value::<Vec<hkpTyremarkPoint>>(&mut __map) {
375 _serde::__private::Ok(__val) => __val,
376 _serde::__private::Err(__err) => {
377 return _serde::__private::Err(__err);
378 }
379 },
380 );
381 }
382 _ => __A::skip_value(&mut __map)?,
383 }
384 }
385 let m_currentPosition = match m_currentPosition {
386 _serde::__private::Some(__field) => __field,
387 _serde::__private::None => {
388 #[cfg(feature = "strict")]
389 return _serde::__private::Err(
390 <__A::Error as _serde::de::Error>::missing_field(
391 "currentPosition",
392 ),
393 );
394 #[cfg(not(feature = "strict"))] Default::default()
395 }
396 };
397 let m_numPoints = match m_numPoints {
398 _serde::__private::Some(__field) => __field,
399 _serde::__private::None => {
400 #[cfg(feature = "strict")]
401 return _serde::__private::Err(
402 <__A::Error as _serde::de::Error>::missing_field(
403 "numPoints",
404 ),
405 );
406 #[cfg(not(feature = "strict"))] Default::default()
407 }
408 };
409 let m_tyremarkPoints = match m_tyremarkPoints {
410 _serde::__private::Some(__field) => __field,
411 _serde::__private::None => {
412 #[cfg(feature = "strict")]
413 return _serde::__private::Err(
414 <__A::Error as _serde::de::Error>::missing_field(
415 "tyremarkPoints",
416 ),
417 );
418 #[cfg(not(feature = "strict"))] Default::default()
419 }
420 };
421 let __ptr = None;
422 let parent = hkBaseObject { __ptr };
423 let parent = hkReferencedObject {
424 __ptr,
425 parent,
426 ..Default::default()
427 };
428 let __ptr = __A::class_ptr(&mut __map);
429 _serde::__private::Ok(hkpTyremarksWheel {
430 __ptr,
431 parent,
432 m_currentPosition,
433 m_numPoints,
434 m_tyremarkPoints,
435 })
436 }
437 }
438 const FIELDS: &[&str] = &["currentPosition", "numPoints", "tyremarkPoints"];
439 _serde::Deserializer::deserialize_struct(
440 deserializer,
441 "hkpTyremarksWheel",
442 FIELDS,
443 __hkpTyremarksWheelVisitor {
444 marker: _serde::__private::PhantomData::<hkpTyremarksWheel>,
445 lifetime: _serde::__private::PhantomData,
446 },
447 )
448 }
449 }
450};