MCPcopy Create free account
hub / github.com/Swampsoft/solitaire / stack_render_system

Method stack_render_system

src/cs/render_systems.rs:81–108  ·  view source on GitHub ↗
(
        &mut self,
        pos: &Component<Point2>,
        stk: &Component<Stack>,
        zs: &Component<f32>,
    )

Source from the content-addressed store, hash-verified

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,

Callers 1

run_renderMethod · 0.80

Calls 3

allMethod · 0.80
get_stackshiftMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected