MCPcopy Create free account
hub / github.com/cgsdev0/termsand / step_fall

Method step_fall

src/main.rs:749–758  ·  view source on GitHub ↗
(&mut self, pos: Vec2, up: Vec2)

Source from the content-addressed store, hash-verified

747 self.snow_bg.step(&self.args, dir);
748 }
749
750 fn step(&mut self, dir: &Vec2) {
751 let yrange: Box<dyn Iterator<Item = usize>> = match dir.y {
752 -1 => Box::new((1..self.height).rev()), // down (process from bottom up)
753 _ => Box::new(0..self.height - 1), // up
754 };
755 let xrange: Box<dyn Iterator<Item = usize>> = match dir.x {
756 -1 => Box::new((1..self.width).rev()),
757 _ => Box::new(0..self.width - 1),
758 };
759 if dir.x == 0 {
760 for y in yrange {
761 for x in 0..self.width {

Callers 1

stepMethod · 0.80

Calls 5

getMethod · 0.80
is_sandMethod · 0.80
is_emptyMethod · 0.80
is_staticMethod · 0.80
swapMethod · 0.80

Tested by

no test coverage detected