(
&mut self,
pos: &Component<Point2>,
stk: &Component<Stack>,
zs: &Component<f32>,
)
| 79 | } |
| 80 | |
| 81 | pub fn stack_render_system( |
| 82 | &mut self, |
| 83 | pos: &Component<Point2>, |
| 84 | stk: &Component<Stack>, |
| 85 | zs: &Component<f32>, |
| 86 | ) -> GameResult<()> { |
| 87 | let compound_iterator = pos |
| 88 | .iter() |
| 89 | .zip(stk.iter()) |
| 90 | .zip(zs.iter()) |
| 91 | .filter_map(|x| -> Option<(_, _, &f32)> { x.all() }); |
| 92 | for (p, s, &z) in compound_iterator { |
| 93 | let mut pos = *p; |
| 94 | let dpos = s.get_stackshift(); |
| 95 | |
| 96 | for (i, card) in s.iter().enumerate() { |
| 97 | let z = z + 0.1 * i as f32; |
| 98 | //graphics::set_color(ctx, graphics::Color::new(1.0, 1.0, 1.0, 1.0))?; |
| 99 | self.queue.push(DrawCommand::Card { |
| 100 | z, |
| 101 | pos: pos, |
| 102 | suite: *card, |
| 103 | }); |
| 104 | pos += dpos; |
| 105 | } |
| 106 | } |
| 107 | Ok(()) |
| 108 | } |
| 109 | |
| 110 | fn render_card( |
| 111 | &self, |
no test coverage detected