// update each particle's vector according to the flow of the cell it's in
update each particle's vector according to the flow of the cell it's in
update each particle ' s vector according to the flow of the cell it ' s in
fn update_particles_vectors(mut particles: ViewMut<Particle>, map:UniqueView<Cells> ) -> Result<(), GameOver> {
    for particle in (&mut particles).iter() {
        let cell_index = particle.get_cell_index();
        let cell = &map.all_cells[cell_index];
        // update particle's vector according to its cell;
        particle.update_velocity_from_cell(cell);
    }
    Ok(())
}
fn update_particles_vectors ( mut particles : ViewMut < Particle > , map : UniqueView < Cells > ) -> Result < ( ) , GameOver > { for particle in ( & mut particles ) . iter ( ) { let cell_index = particle . get_cell_index ( ) ; let cell = & map . all_cells [ cell_index ] ; // update particle's vector according to its cell; particle . update_velocity_from_cell ( cell ) ; } Ok ( ( ) ) }
update each particle's vector according to the flow of the cell it's in
update each particle ' s vector according to the flow of the cell it ' s in
particles
ViewMut<Particle>
map
UniqueView<Cells>