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 hkxAttributeGroup<'a> {
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 = "serde", serde(borrow))]
31 #[cfg_attr(feature = "json_schema", schemars(rename = "name"))]
32 #[cfg_attr(feature = "serde", serde(rename = "name"))]
33 pub m_name: StringPtr<'a>,
34 #[cfg_attr(feature = "serde", serde(borrow))]
39 #[cfg_attr(feature = "json_schema", schemars(rename = "attributes"))]
40 #[cfg_attr(feature = "serde", serde(rename = "attributes"))]
41 pub m_attributes: Vec<hkxAttribute<'a>>,
42}
43const _: () = {
44 use havok_serde as _serde;
45 impl<'a> _serde::HavokClass for hkxAttributeGroup<'a> {
46 #[inline]
47 fn name(&self) -> &'static str {
48 "hkxAttributeGroup"
49 }
50 #[inline]
51 fn signature(&self) -> _serde::__private::Signature {
52 _serde::__private::Signature::new(0x345ca95d)
53 }
54 #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
55 fn deps_indexes(&self) -> Vec<usize> {
56 let mut v = Vec::new();
57 v.extend(
58 self
59 .m_attributes
60 .iter()
61 .flat_map(|class| class.deps_indexes())
62 .collect::<Vec<usize>>(),
63 );
64 v
65 }
66 }
67 impl<'a> _serde::Serialize for hkxAttributeGroup<'a> {
68 fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
69 where
70 S: _serde::ser::Serializer,
71 {
72 let class_meta = self
73 .__ptr
74 .map(|name| (name, _serde::__private::Signature::new(0x345ca95d)));
75 let mut serializer = __serializer
76 .serialize_struct("hkxAttributeGroup", class_meta, (16u64, 24u64))?;
77 serializer.serialize_field("name", &self.m_name)?;
78 serializer
79 .serialize_array_field(
80 "attributes",
81 &self.m_attributes,
82 TypeSize::Struct {
83 size_x86: 8u64,
84 size_x86_64: 16u64,
85 },
86 )?;
87 serializer.end()
88 }
89 }
90};
91#[doc(hidden)]
92#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
93const _: () = {
94 use havok_serde as _serde;
95 #[automatically_derived]
96 impl<'de> _serde::Deserialize<'de> for hkxAttributeGroup<'de> {
97 fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
98 where
99 __D: _serde::Deserializer<'de>,
100 {
101 #[allow(non_camel_case_types)]
102 enum __Field {
103 m_name,
104 m_attributes,
105 __ignore,
106 }
107 struct __FieldVisitor;
108 impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
109 type Value = __Field;
110 fn expecting(
111 &self,
112 __formatter: &mut core::fmt::Formatter,
113 ) -> core::fmt::Result {
114 core::fmt::Formatter::write_str(__formatter, "field identifier")
115 }
116 #[allow(clippy::match_single_binding)]
118 #[allow(clippy::reversed_empty_ranges)]
119 #[allow(clippy::single_match)]
120 fn visit_key<__E>(
121 self,
122 __value: &str,
123 ) -> core::result::Result<Self::Value, __E>
124 where
125 __E: _serde::de::Error,
126 {
127 match __value {
128 "name" => Ok(__Field::m_name),
129 "attributes" => Ok(__Field::m_attributes),
130 _ => Ok(__Field::__ignore),
131 }
132 }
133 }
134 impl<'de> _serde::Deserialize<'de> for __Field {
135 #[inline]
136 fn deserialize<__D>(
137 __deserializer: __D,
138 ) -> core::result::Result<Self, __D::Error>
139 where
140 __D: _serde::Deserializer<'de>,
141 {
142 _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
143 }
144 }
145 struct __hkxAttributeGroupVisitor<'de> {
146 marker: _serde::__private::PhantomData<hkxAttributeGroup<'de>>,
147 lifetime: _serde::__private::PhantomData<&'de ()>,
148 }
149 #[allow(clippy::match_single_binding)]
150 #[allow(clippy::reversed_empty_ranges)]
151 #[allow(clippy::single_match)]
152 impl<'de> _serde::de::Visitor<'de> for __hkxAttributeGroupVisitor<'de> {
153 type Value = hkxAttributeGroup<'de>;
154 fn expecting(
155 &self,
156 __formatter: &mut core::fmt::Formatter,
157 ) -> core::fmt::Result {
158 core::fmt::Formatter::write_str(
159 __formatter,
160 "struct hkxAttributeGroup",
161 )
162 }
163 fn visit_struct_for_bytes<__A>(
164 self,
165 mut __map: __A,
166 ) -> _serde::__private::Result<Self::Value, __A::Error>
167 where
168 __A: _serde::de::MapAccess<'de>,
169 {
170 let __ptr = __A::class_ptr(&mut __map);
171 let mut m_name: _serde::__private::Option<StringPtr<'de>> = _serde::__private::None;
172 let mut m_attributes: _serde::__private::Option<
173 Vec<hkxAttribute<'de>>,
174 > = _serde::__private::None;
175 for i in 0..2usize {
176 match i {
177 0usize => {
178 if _serde::__private::Option::is_some(&m_name) {
179 return _serde::__private::Err(
180 <__A::Error as _serde::de::Error>::duplicate_field("name"),
181 );
182 }
183 m_name = _serde::__private::Some(
184 match __A::next_value::<StringPtr<'de>>(&mut __map) {
185 _serde::__private::Ok(__val) => __val,
186 _serde::__private::Err(__err) => {
187 return _serde::__private::Err(__err);
188 }
189 },
190 );
191 }
192 1usize => {
193 if _serde::__private::Option::is_some(&m_attributes) {
194 return _serde::__private::Err(
195 <__A::Error as _serde::de::Error>::duplicate_field(
196 "attributes",
197 ),
198 );
199 }
200 m_attributes = _serde::__private::Some(
201 match __A::next_value::<
202 Vec<hkxAttribute<'de>>,
203 >(&mut __map) {
204 _serde::__private::Ok(__val) => __val,
205 _serde::__private::Err(__err) => {
206 return _serde::__private::Err(__err);
207 }
208 },
209 );
210 }
211 _ => {}
212 }
213 }
214 let m_name = match m_name {
215 _serde::__private::Some(__field) => __field,
216 _serde::__private::None => {
217 return _serde::__private::Err(
218 <__A::Error as _serde::de::Error>::missing_field("name"),
219 );
220 }
221 };
222 let m_attributes = match m_attributes {
223 _serde::__private::Some(__field) => __field,
224 _serde::__private::None => {
225 return _serde::__private::Err(
226 <__A::Error as _serde::de::Error>::missing_field(
227 "attributes",
228 ),
229 );
230 }
231 };
232 _serde::__private::Ok(hkxAttributeGroup {
233 __ptr,
234 m_name,
235 m_attributes,
236 })
237 }
238 #[allow(clippy::manual_unwrap_or_default)]
239 fn visit_struct<__A>(
240 self,
241 mut __map: __A,
242 ) -> _serde::__private::Result<Self::Value, __A::Error>
243 where
244 __A: _serde::de::MapAccess<'de>,
245 {
246 let mut m_name: _serde::__private::Option<StringPtr<'de>> = _serde::__private::None;
247 let mut m_attributes: _serde::__private::Option<
248 Vec<hkxAttribute<'de>>,
249 > = _serde::__private::None;
250 while let _serde::__private::Some(__key) = {
251 __A::next_key::<__Field>(&mut __map)?
252 } {
253 match __key {
254 __Field::m_name => {
255 #[cfg(
256 any(feature = "strict", feature = "ignore_duplicates")
257 )]
258 if _serde::__private::Option::is_some(&m_name) {
259 #[cfg(feature = "ignore_duplicates")]
260 {
261 __A::skip_value(&mut __map)?;
262 continue;
263 }
264 #[cfg(feature = "strict")]
265 return _serde::__private::Err(
266 <__A::Error as _serde::de::Error>::duplicate_field("name"),
267 );
268 }
269 m_name = _serde::__private::Some(
270 match __A::next_value::<StringPtr<'de>>(&mut __map) {
271 _serde::__private::Ok(__val) => __val,
272 _serde::__private::Err(__err) => {
273 return _serde::__private::Err(__err);
274 }
275 },
276 );
277 }
278 __Field::m_attributes => {
279 #[cfg(
280 any(feature = "strict", feature = "ignore_duplicates")
281 )]
282 if _serde::__private::Option::is_some(&m_attributes) {
283 #[cfg(feature = "ignore_duplicates")]
284 {
285 __A::skip_value(&mut __map)?;
286 continue;
287 }
288 #[cfg(feature = "strict")]
289 return _serde::__private::Err(
290 <__A::Error as _serde::de::Error>::duplicate_field(
291 "attributes",
292 ),
293 );
294 }
295 m_attributes = _serde::__private::Some(
296 match __A::next_value::<
297 Vec<hkxAttribute<'de>>,
298 >(&mut __map) {
299 _serde::__private::Ok(__val) => __val,
300 _serde::__private::Err(__err) => {
301 return _serde::__private::Err(__err);
302 }
303 },
304 );
305 }
306 _ => __A::skip_value(&mut __map)?,
307 }
308 }
309 let m_name = match m_name {
310 _serde::__private::Some(__field) => __field,
311 _serde::__private::None => {
312 #[cfg(feature = "strict")]
313 return _serde::__private::Err(
314 <__A::Error as _serde::de::Error>::missing_field("name"),
315 );
316 #[cfg(not(feature = "strict"))] Default::default()
317 }
318 };
319 let m_attributes = match m_attributes {
320 _serde::__private::Some(__field) => __field,
321 _serde::__private::None => {
322 #[cfg(feature = "strict")]
323 return _serde::__private::Err(
324 <__A::Error as _serde::de::Error>::missing_field(
325 "attributes",
326 ),
327 );
328 #[cfg(not(feature = "strict"))] Default::default()
329 }
330 };
331 let __ptr = __A::class_ptr(&mut __map);
332 _serde::__private::Ok(hkxAttributeGroup {
333 __ptr,
334 m_name,
335 m_attributes,
336 })
337 }
338 }
339 const FIELDS: &[&str] = &["name", "attributes"];
340 _serde::Deserializer::deserialize_struct(
341 deserializer,
342 "hkxAttributeGroup",
343 FIELDS,
344 __hkxAttributeGroupVisitor {
345 marker: _serde::__private::PhantomData::<hkxAttributeGroup>,
346 lifetime: _serde::__private::PhantomData,
347 },
348 )
349 }
350 }
351};