MCPcopy Create free account
hub / github.com/PerroEngine/Perro / parse_add_kind

Method parse_add_kind

perro_source/core/perro_animation/src/anim_tree.rs:268–293  ·  view source on GitHub ↗
(&mut self, close_block: &str)

Source from the content-addressed store, hash-verified

266 }
267
268 fn parse_add_kind(&mut self, close_block: &str) -> Result<AnimationTreeNodeKind, String> {
269 let mut base = Cow::Borrowed("");
270 let mut inputs = Vec::new();
271 let mut weights = Vec::new();
272 let mut mask = AnimationTreeMask::default();
273 loop {
274 if self.consume_close(close_block)? {
275 break;
276 }
277 let key = self.expect_ident()?;
278 self.expect(Token::Equals)?;
279 match key.as_str() {
280 "base" => base = Cow::Owned(self.expect_ref()?),
281 "inputs" => inputs = self.parse_ref_list()?,
282 "weights" => weights = self.parse_f32_list()?,
283 "mask" => mask = self.parse_mask()?,
284 _ => self.skip_value()?,
285 }
286 }
287 Ok(AnimationTreeNodeKind::Add {
288 base,
289 inputs: Cow::Owned(inputs.into_iter().map(Cow::Owned).collect()),
290 weights: Cow::Owned(weights),
291 mask,
292 })
293 }
294
295 fn parse_invert_kind(&mut self) -> Result<AnimationTreeNodeKind, String> {
296 let mut input = Cow::Borrowed("");

Callers 1

Calls 9

consume_closeMethod · 0.80
expect_refMethod · 0.80
parse_ref_listMethod · 0.80
parse_f32_listMethod · 0.80
parse_maskMethod · 0.80
skip_valueMethod · 0.80
expect_identMethod · 0.45
expectMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected