havok_classes/generated/
hkbBehaviorGraphStringData_.rs

1use super::class_requires::*;
2use super::*;
3/// # C++ Info
4/// - name: `hkbBehaviorGraphStringData`
5/// - version: `1`
6/// - signature: `0xc713064e`
7/// - size: ` 56`(x86)/` 80`(x86_64)
8/// -  vtable: `true`
9#[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 hkbBehaviorGraphStringData<'a> {
15    /// # Unique index for this class
16    /// - Represents a pointer on XML (`<hkobject name="#0001"></hkobject>`)
17    /// - [`Option::None`] => This class is `class in field`.(`<hkobject></hkobject>`)
18    ///
19    /// # Note
20    /// Not present in the binary & Not exist actual C++ field.
21    #[cfg_attr(
22        feature = "serde",
23        serde(skip_serializing_if = "Option::is_none", default)
24    )]
25    pub __ptr: Option<Pointer>,
26    /// Alternative to C++ class inheritance.
27    #[cfg_attr(feature = "json_schema", schemars(flatten))]
28    #[cfg_attr(feature = "serde", serde(flatten))]
29    pub parent: hkReferencedObject,
30    /// # C++ Info
31    /// - name: `eventNames`(ctype: `hkArray<hkStringPtr>`)
32    /// - offset: `  8`(x86)/` 16`(x86_64)
33    /// - type_size: ` 12`(x86)/` 16`(x86_64)
34    #[cfg_attr(feature = "serde", serde(borrow))]
35    #[cfg_attr(feature = "json_schema", schemars(rename = "eventNames"))]
36    #[cfg_attr(feature = "serde", serde(rename = "eventNames"))]
37    pub m_eventNames: Vec<StringPtr<'a>>,
38    /// # C++ Info
39    /// - name: `attributeNames`(ctype: `hkArray<hkStringPtr>`)
40    /// - offset: ` 20`(x86)/` 32`(x86_64)
41    /// - type_size: ` 12`(x86)/` 16`(x86_64)
42    #[cfg_attr(feature = "serde", serde(borrow))]
43    #[cfg_attr(feature = "json_schema", schemars(rename = "attributeNames"))]
44    #[cfg_attr(feature = "serde", serde(rename = "attributeNames"))]
45    pub m_attributeNames: Vec<StringPtr<'a>>,
46    /// # C++ Info
47    /// - name: `variableNames`(ctype: `hkArray<hkStringPtr>`)
48    /// - offset: ` 32`(x86)/` 48`(x86_64)
49    /// - type_size: ` 12`(x86)/` 16`(x86_64)
50    #[cfg_attr(feature = "serde", serde(borrow))]
51    #[cfg_attr(feature = "json_schema", schemars(rename = "variableNames"))]
52    #[cfg_attr(feature = "serde", serde(rename = "variableNames"))]
53    pub m_variableNames: Vec<StringPtr<'a>>,
54    /// # C++ Info
55    /// - name: `characterPropertyNames`(ctype: `hkArray<hkStringPtr>`)
56    /// - offset: ` 44`(x86)/` 64`(x86_64)
57    /// - type_size: ` 12`(x86)/` 16`(x86_64)
58    #[cfg_attr(feature = "serde", serde(borrow))]
59    #[cfg_attr(feature = "json_schema", schemars(rename = "characterPropertyNames"))]
60    #[cfg_attr(feature = "serde", serde(rename = "characterPropertyNames"))]
61    pub m_characterPropertyNames: Vec<StringPtr<'a>>,
62}
63const _: () = {
64    use havok_serde as _serde;
65    impl<'a> _serde::HavokClass for hkbBehaviorGraphStringData<'a> {
66        #[inline]
67        fn name(&self) -> &'static str {
68            "hkbBehaviorGraphStringData"
69        }
70        #[inline]
71        fn signature(&self) -> _serde::__private::Signature {
72            _serde::__private::Signature::new(0xc713064e)
73        }
74        #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
75        fn deps_indexes(&self) -> Vec<usize> {
76            let mut v = Vec::new();
77            v
78        }
79    }
80    impl<'a> _serde::Serialize for hkbBehaviorGraphStringData<'a> {
81        fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
82        where
83            S: _serde::ser::Serializer,
84        {
85            let class_meta = self
86                .__ptr
87                .map(|name| (name, _serde::__private::Signature::new(0xc713064e)));
88            let mut serializer = __serializer
89                .serialize_struct(
90                    "hkbBehaviorGraphStringData",
91                    class_meta,
92                    (56u64, 80u64),
93                )?;
94            serializer.pad_field([0u8; 4usize].as_slice(), [0u8; 8usize].as_slice())?;
95            serializer.skip_field("memSizeAndFlags", &self.parent.m_memSizeAndFlags)?;
96            serializer.skip_field("referenceCount", &self.parent.m_referenceCount)?;
97            serializer.pad_field([0u8; 0usize].as_slice(), [0u8; 4usize].as_slice())?;
98            serializer
99                .serialize_array_field(
100                    "eventNames",
101                    &self.m_eventNames,
102                    TypeSize::String,
103                )?;
104            serializer
105                .serialize_array_field(
106                    "attributeNames",
107                    &self.m_attributeNames,
108                    TypeSize::String,
109                )?;
110            serializer
111                .serialize_array_field(
112                    "variableNames",
113                    &self.m_variableNames,
114                    TypeSize::String,
115                )?;
116            serializer
117                .serialize_array_field(
118                    "characterPropertyNames",
119                    &self.m_characterPropertyNames,
120                    TypeSize::String,
121                )?;
122            serializer.end()
123        }
124    }
125};
126#[doc(hidden)]
127#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
128const _: () = {
129    use havok_serde as _serde;
130    #[automatically_derived]
131    impl<'de> _serde::Deserialize<'de> for hkbBehaviorGraphStringData<'de> {
132        fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
133        where
134            __D: _serde::Deserializer<'de>,
135        {
136            #[allow(non_camel_case_types)]
137            enum __Field {
138                m_eventNames,
139                m_attributeNames,
140                m_variableNames,
141                m_characterPropertyNames,
142                __ignore,
143            }
144            struct __FieldVisitor;
145            impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
146                type Value = __Field;
147                fn expecting(
148                    &self,
149                    __formatter: &mut core::fmt::Formatter,
150                ) -> core::fmt::Result {
151                    core::fmt::Formatter::write_str(__formatter, "field identifier")
152                }
153                /// Intended for use in XML.
154                #[allow(clippy::match_single_binding)]
155                #[allow(clippy::reversed_empty_ranges)]
156                #[allow(clippy::single_match)]
157                fn visit_key<__E>(
158                    self,
159                    __value: &str,
160                ) -> core::result::Result<Self::Value, __E>
161                where
162                    __E: _serde::de::Error,
163                {
164                    match __value {
165                        "eventNames" => Ok(__Field::m_eventNames),
166                        "attributeNames" => Ok(__Field::m_attributeNames),
167                        "variableNames" => Ok(__Field::m_variableNames),
168                        "characterPropertyNames" => Ok(__Field::m_characterPropertyNames),
169                        _ => Ok(__Field::__ignore),
170                    }
171                }
172            }
173            impl<'de> _serde::Deserialize<'de> for __Field {
174                #[inline]
175                fn deserialize<__D>(
176                    __deserializer: __D,
177                ) -> core::result::Result<Self, __D::Error>
178                where
179                    __D: _serde::Deserializer<'de>,
180                {
181                    _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
182                }
183            }
184            struct __hkbBehaviorGraphStringDataVisitor<'de> {
185                marker: _serde::__private::PhantomData<hkbBehaviorGraphStringData<'de>>,
186                lifetime: _serde::__private::PhantomData<&'de ()>,
187            }
188            #[allow(clippy::match_single_binding)]
189            #[allow(clippy::reversed_empty_ranges)]
190            #[allow(clippy::single_match)]
191            impl<'de> _serde::de::Visitor<'de>
192            for __hkbBehaviorGraphStringDataVisitor<'de> {
193                type Value = hkbBehaviorGraphStringData<'de>;
194                fn expecting(
195                    &self,
196                    __formatter: &mut core::fmt::Formatter,
197                ) -> core::fmt::Result {
198                    core::fmt::Formatter::write_str(
199                        __formatter,
200                        "struct hkbBehaviorGraphStringData",
201                    )
202                }
203                fn visit_struct_for_bytes<__A>(
204                    self,
205                    mut __map: __A,
206                ) -> _serde::__private::Result<Self::Value, __A::Error>
207                where
208                    __A: _serde::de::MapAccess<'de>,
209                {
210                    let __ptr = __A::class_ptr(&mut __map);
211                    let parent = __A::parent_value(&mut __map)?;
212                    let mut m_eventNames: _serde::__private::Option<
213                        Vec<StringPtr<'de>>,
214                    > = _serde::__private::None;
215                    let mut m_attributeNames: _serde::__private::Option<
216                        Vec<StringPtr<'de>>,
217                    > = _serde::__private::None;
218                    let mut m_variableNames: _serde::__private::Option<
219                        Vec<StringPtr<'de>>,
220                    > = _serde::__private::None;
221                    let mut m_characterPropertyNames: _serde::__private::Option<
222                        Vec<StringPtr<'de>>,
223                    > = _serde::__private::None;
224                    for i in 0..4usize {
225                        match i {
226                            0usize => {
227                                if _serde::__private::Option::is_some(&m_eventNames) {
228                                    return _serde::__private::Err(
229                                        <__A::Error as _serde::de::Error>::duplicate_field(
230                                            "eventNames",
231                                        ),
232                                    );
233                                }
234                                m_eventNames = _serde::__private::Some(
235                                    match __A::next_value::<Vec<StringPtr<'de>>>(&mut __map) {
236                                        _serde::__private::Ok(__val) => __val,
237                                        _serde::__private::Err(__err) => {
238                                            return _serde::__private::Err(__err);
239                                        }
240                                    },
241                                );
242                            }
243                            1usize => {
244                                if _serde::__private::Option::is_some(&m_attributeNames) {
245                                    return _serde::__private::Err(
246                                        <__A::Error as _serde::de::Error>::duplicate_field(
247                                            "attributeNames",
248                                        ),
249                                    );
250                                }
251                                m_attributeNames = _serde::__private::Some(
252                                    match __A::next_value::<Vec<StringPtr<'de>>>(&mut __map) {
253                                        _serde::__private::Ok(__val) => __val,
254                                        _serde::__private::Err(__err) => {
255                                            return _serde::__private::Err(__err);
256                                        }
257                                    },
258                                );
259                            }
260                            2usize => {
261                                if _serde::__private::Option::is_some(&m_variableNames) {
262                                    return _serde::__private::Err(
263                                        <__A::Error as _serde::de::Error>::duplicate_field(
264                                            "variableNames",
265                                        ),
266                                    );
267                                }
268                                m_variableNames = _serde::__private::Some(
269                                    match __A::next_value::<Vec<StringPtr<'de>>>(&mut __map) {
270                                        _serde::__private::Ok(__val) => __val,
271                                        _serde::__private::Err(__err) => {
272                                            return _serde::__private::Err(__err);
273                                        }
274                                    },
275                                );
276                            }
277                            3usize => {
278                                if _serde::__private::Option::is_some(
279                                    &m_characterPropertyNames,
280                                ) {
281                                    return _serde::__private::Err(
282                                        <__A::Error as _serde::de::Error>::duplicate_field(
283                                            "characterPropertyNames",
284                                        ),
285                                    );
286                                }
287                                m_characterPropertyNames = _serde::__private::Some(
288                                    match __A::next_value::<Vec<StringPtr<'de>>>(&mut __map) {
289                                        _serde::__private::Ok(__val) => __val,
290                                        _serde::__private::Err(__err) => {
291                                            return _serde::__private::Err(__err);
292                                        }
293                                    },
294                                );
295                            }
296                            _ => {}
297                        }
298                    }
299                    let m_eventNames = match m_eventNames {
300                        _serde::__private::Some(__field) => __field,
301                        _serde::__private::None => {
302                            return _serde::__private::Err(
303                                <__A::Error as _serde::de::Error>::missing_field(
304                                    "eventNames",
305                                ),
306                            );
307                        }
308                    };
309                    let m_attributeNames = match m_attributeNames {
310                        _serde::__private::Some(__field) => __field,
311                        _serde::__private::None => {
312                            return _serde::__private::Err(
313                                <__A::Error as _serde::de::Error>::missing_field(
314                                    "attributeNames",
315                                ),
316                            );
317                        }
318                    };
319                    let m_variableNames = match m_variableNames {
320                        _serde::__private::Some(__field) => __field,
321                        _serde::__private::None => {
322                            return _serde::__private::Err(
323                                <__A::Error as _serde::de::Error>::missing_field(
324                                    "variableNames",
325                                ),
326                            );
327                        }
328                    };
329                    let m_characterPropertyNames = match m_characterPropertyNames {
330                        _serde::__private::Some(__field) => __field,
331                        _serde::__private::None => {
332                            return _serde::__private::Err(
333                                <__A::Error as _serde::de::Error>::missing_field(
334                                    "characterPropertyNames",
335                                ),
336                            );
337                        }
338                    };
339                    _serde::__private::Ok(hkbBehaviorGraphStringData {
340                        __ptr,
341                        parent,
342                        m_eventNames,
343                        m_attributeNames,
344                        m_variableNames,
345                        m_characterPropertyNames,
346                    })
347                }
348                #[allow(clippy::manual_unwrap_or_default)]
349                fn visit_struct<__A>(
350                    self,
351                    mut __map: __A,
352                ) -> _serde::__private::Result<Self::Value, __A::Error>
353                where
354                    __A: _serde::de::MapAccess<'de>,
355                {
356                    let mut m_eventNames: _serde::__private::Option<
357                        Vec<StringPtr<'de>>,
358                    > = _serde::__private::None;
359                    let mut m_attributeNames: _serde::__private::Option<
360                        Vec<StringPtr<'de>>,
361                    > = _serde::__private::None;
362                    let mut m_variableNames: _serde::__private::Option<
363                        Vec<StringPtr<'de>>,
364                    > = _serde::__private::None;
365                    let mut m_characterPropertyNames: _serde::__private::Option<
366                        Vec<StringPtr<'de>>,
367                    > = _serde::__private::None;
368                    while let _serde::__private::Some(__key) = {
369                        __A::next_key::<__Field>(&mut __map)?
370                    } {
371                        match __key {
372                            __Field::m_eventNames => {
373                                #[cfg(
374                                    any(feature = "strict", feature = "ignore_duplicates")
375                                )]
376                                if _serde::__private::Option::is_some(&m_eventNames) {
377                                    #[cfg(feature = "ignore_duplicates")]
378                                    {
379                                        __A::skip_value(&mut __map)?;
380                                        continue;
381                                    }
382                                    #[cfg(feature = "strict")]
383                                    return _serde::__private::Err(
384                                        <__A::Error as _serde::de::Error>::duplicate_field(
385                                            "eventNames",
386                                        ),
387                                    );
388                                }
389                                m_eventNames = _serde::__private::Some(
390                                    match __A::next_value::<Vec<StringPtr<'de>>>(&mut __map) {
391                                        _serde::__private::Ok(__val) => __val,
392                                        _serde::__private::Err(__err) => {
393                                            return _serde::__private::Err(__err);
394                                        }
395                                    },
396                                );
397                            }
398                            __Field::m_attributeNames => {
399                                #[cfg(
400                                    any(feature = "strict", feature = "ignore_duplicates")
401                                )]
402                                if _serde::__private::Option::is_some(&m_attributeNames) {
403                                    #[cfg(feature = "ignore_duplicates")]
404                                    {
405                                        __A::skip_value(&mut __map)?;
406                                        continue;
407                                    }
408                                    #[cfg(feature = "strict")]
409                                    return _serde::__private::Err(
410                                        <__A::Error as _serde::de::Error>::duplicate_field(
411                                            "attributeNames",
412                                        ),
413                                    );
414                                }
415                                m_attributeNames = _serde::__private::Some(
416                                    match __A::next_value::<Vec<StringPtr<'de>>>(&mut __map) {
417                                        _serde::__private::Ok(__val) => __val,
418                                        _serde::__private::Err(__err) => {
419                                            return _serde::__private::Err(__err);
420                                        }
421                                    },
422                                );
423                            }
424                            __Field::m_variableNames => {
425                                #[cfg(
426                                    any(feature = "strict", feature = "ignore_duplicates")
427                                )]
428                                if _serde::__private::Option::is_some(&m_variableNames) {
429                                    #[cfg(feature = "ignore_duplicates")]
430                                    {
431                                        __A::skip_value(&mut __map)?;
432                                        continue;
433                                    }
434                                    #[cfg(feature = "strict")]
435                                    return _serde::__private::Err(
436                                        <__A::Error as _serde::de::Error>::duplicate_field(
437                                            "variableNames",
438                                        ),
439                                    );
440                                }
441                                m_variableNames = _serde::__private::Some(
442                                    match __A::next_value::<Vec<StringPtr<'de>>>(&mut __map) {
443                                        _serde::__private::Ok(__val) => __val,
444                                        _serde::__private::Err(__err) => {
445                                            return _serde::__private::Err(__err);
446                                        }
447                                    },
448                                );
449                            }
450                            __Field::m_characterPropertyNames => {
451                                #[cfg(
452                                    any(feature = "strict", feature = "ignore_duplicates")
453                                )]
454                                if _serde::__private::Option::is_some(
455                                    &m_characterPropertyNames,
456                                ) {
457                                    #[cfg(feature = "ignore_duplicates")]
458                                    {
459                                        __A::skip_value(&mut __map)?;
460                                        continue;
461                                    }
462                                    #[cfg(feature = "strict")]
463                                    return _serde::__private::Err(
464                                        <__A::Error as _serde::de::Error>::duplicate_field(
465                                            "characterPropertyNames",
466                                        ),
467                                    );
468                                }
469                                m_characterPropertyNames = _serde::__private::Some(
470                                    match __A::next_value::<Vec<StringPtr<'de>>>(&mut __map) {
471                                        _serde::__private::Ok(__val) => __val,
472                                        _serde::__private::Err(__err) => {
473                                            return _serde::__private::Err(__err);
474                                        }
475                                    },
476                                );
477                            }
478                            _ => __A::skip_value(&mut __map)?,
479                        }
480                    }
481                    let m_eventNames = match m_eventNames {
482                        _serde::__private::Some(__field) => __field,
483                        _serde::__private::None => {
484                            #[cfg(feature = "strict")]
485                            return _serde::__private::Err(
486                                <__A::Error as _serde::de::Error>::missing_field(
487                                    "eventNames",
488                                ),
489                            );
490                            #[cfg(not(feature = "strict"))] Default::default()
491                        }
492                    };
493                    let m_attributeNames = match m_attributeNames {
494                        _serde::__private::Some(__field) => __field,
495                        _serde::__private::None => {
496                            #[cfg(feature = "strict")]
497                            return _serde::__private::Err(
498                                <__A::Error as _serde::de::Error>::missing_field(
499                                    "attributeNames",
500                                ),
501                            );
502                            #[cfg(not(feature = "strict"))] Default::default()
503                        }
504                    };
505                    let m_variableNames = match m_variableNames {
506                        _serde::__private::Some(__field) => __field,
507                        _serde::__private::None => {
508                            #[cfg(feature = "strict")]
509                            return _serde::__private::Err(
510                                <__A::Error as _serde::de::Error>::missing_field(
511                                    "variableNames",
512                                ),
513                            );
514                            #[cfg(not(feature = "strict"))] Default::default()
515                        }
516                    };
517                    let m_characterPropertyNames = match m_characterPropertyNames {
518                        _serde::__private::Some(__field) => __field,
519                        _serde::__private::None => {
520                            #[cfg(feature = "strict")]
521                            return _serde::__private::Err(
522                                <__A::Error as _serde::de::Error>::missing_field(
523                                    "characterPropertyNames",
524                                ),
525                            );
526                            #[cfg(not(feature = "strict"))] Default::default()
527                        }
528                    };
529                    let __ptr = None;
530                    let parent = hkBaseObject { __ptr };
531                    let parent = hkReferencedObject {
532                        __ptr,
533                        parent,
534                        ..Default::default()
535                    };
536                    let __ptr = __A::class_ptr(&mut __map);
537                    _serde::__private::Ok(hkbBehaviorGraphStringData {
538                        __ptr,
539                        parent,
540                        m_eventNames,
541                        m_attributeNames,
542                        m_variableNames,
543                        m_characterPropertyNames,
544                    })
545                }
546            }
547            const FIELDS: &[&str] = &[
548                "eventNames",
549                "attributeNames",
550                "variableNames",
551                "characterPropertyNames",
552            ];
553            _serde::Deserializer::deserialize_struct(
554                deserializer,
555                "hkbBehaviorGraphStringData",
556                FIELDS,
557                __hkbBehaviorGraphStringDataVisitor {
558                    marker: _serde::__private::PhantomData::<hkbBehaviorGraphStringData>,
559                    lifetime: _serde::__private::PhantomData,
560                },
561            )
562        }
563    }
564};