Skip to content

Commit

Permalink
replace deprecated EventReader iter with read
Browse files Browse the repository at this point in the history
  • Loading branch information
alexichepura committed Nov 29, 2023
1 parent 24f2e1d commit 2e2bea6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion camera/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 273,7 @@ pub fn camera_controller_system(
let dt = time.delta_seconds();

let mut mouse_delta = Vec2::ZERO;
for mouse_event in mouse_events.iter() {
for mouse_event in mouse_events.read() {
mouse_delta = mouse_event.delta;
}

Expand Down
2 changes: 1 addition & 1 deletion nn/src/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 127,7 @@ pub fn api_read_stream_event_writer_system(
}
}
pub fn api_event_reader_system(mut reader: EventReader<StreamEvent>) {
for event in reader.iter() {
for event in reader.read() {
dbg!(&event.0);
}
}
2 changes: 1 addition & 1 deletion nn/src/dqn_bevy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 156,7 @@ pub fn dqn_event_reader_system(
mut reader: EventReader<DqnEvent>,
mut cars_dqn: NonSendMut<CarsDqnResource>,
) {
for event in reader.iter() {
for event in reader.read() {
// dbg!((&event.0.duration_string, &event.0.loss_string));
println!(
"dqn_event:{}:{}",
Expand Down
2 changes: 1 addition & 1 deletion src/joystick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 81,7 @@ fn update_joystick(
mut cars: Query<&mut Car, With<Player>>,
) {
for mut car in cars.iter_mut() {
for j in virtual_joystick_events.iter() {
for j in virtual_joystick_events.read() {
let Vec2 { x, y } = j.axis();
// println!("x{x}, y{y}");
match j.id() {
Expand Down
2 changes: 1 addition & 1 deletion src/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 16,7 @@ pub fn spawn_car_system(
track_config: ResMut<TrackConfig>,
car_res: ResMut<CarRes>,
) {
for spawn_event in events.iter() {
for spawn_event in events.read() {
dbg!(spawn_event);

let (transform, init_meters) = if let Some(init_meters) = spawn_event.position {
Expand Down

0 comments on commit 2e2bea6

Please sign in to comment.