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