From 356caa09e00848f8ba52c4882b926eb0eead5507 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 10 Jan 2022 13:50:52 -0600 Subject: [PATCH] WIP: Begin porting to Bevy 0.6. --- Cargo.toml | 5 ++-- src/core.rs | 40 ++++++++++++++---------------- src/error.rs | 2 +- src/exploration.rs | 62 ++++++++++++++-------------------------------- src/log.rs | 12 ++++----- src/map.rs | 30 ++++++++++++---------- src/navigation.rs | 26 +++++++++---------- src/pathfinding.rs | 51 +++++++++++++++++++++++++------------- src/sound.rs | 22 ++++++++-------- src/visibility.rs | 26 +++++++++---------- 10 files changed, 132 insertions(+), 144 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ab20722..463eca8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,11 +7,10 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies.bevy] -version = "0.5" +version = "0.6" default-features = false features = [ "bevy_gilrs", - "bevy_wgpu", "bevy_winit", "render", "x11", @@ -23,7 +22,7 @@ features = [ backtrace = "0.3" bevy_input_actionmap = { path = "../bevy_input_actionmap" } bevy_openal = { path = "../bevy_openal" } -bevy_rapier2d = { version = "0.11", features = ["serde-serialize", "simd-stable"] } +bevy_rapier2d = { version = "0.12", features = ["serde-serialize", "simd-stable"] } bevy_tts = { path = "../bevy_tts" } coord_2d = "0.3" derive_more = "0.99" diff --git a/src/core.rs b/src/core.rs index ce9d3d3..6c3c803 100644 --- a/src/core.rs +++ b/src/core.rs @@ -14,7 +14,7 @@ use once_cell::sync::Lazy; use rand::prelude::*; use serde::{Deserialize, Serialize}; -#[derive(Clone, Copy, Debug, Default, Deref, DerefMut, PartialEq, PartialOrd, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, Deref, DerefMut, PartialEq, PartialOrd, Reflect)] #[reflect(Component)] pub struct Coordinates(pub (f32, f32)); @@ -260,7 +260,7 @@ impl Display for MovementDirection { } } -#[derive(Clone, Copy, Debug, Eq, PartialEq)] +#[derive(Component, Clone, Copy, Debug, Eq, PartialEq)] pub enum CardinalDirection { North, East, @@ -570,7 +570,7 @@ impl From<&dyn PointLike> for (i32, i32) { } } -#[derive(Clone, Copy, Debug, Default, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, Reflect)] #[reflect(Component)] pub struct Player; @@ -645,10 +645,10 @@ fn copy_coordinates_to_transform( (&Coordinates, &mut Transform), ( Changed, - Without, - Without, - Without, - Without, + Without, + Without, + Without, + Without, ), >, ) { @@ -666,8 +666,8 @@ fn copy_coordinates_to_transform( fn copy_rigid_body_position_to_coordinates( mut query: Query< - (&mut Coordinates, &RigidBodyPosition), - (Changed, With), + (&mut Coordinates, &RigidBodyPositionComponent), + (Changed, With), >, ) { for (mut coordinates, position) in query.iter_mut() { @@ -682,11 +682,11 @@ fn copy_rigid_body_position_to_coordinates( fn copy_collider_position_to_coordinates( mut query: Query< - (&mut Coordinates, &ColliderPosition), + (&mut Coordinates, &ColliderPositionComponent), ( - Without, - Changed, - With, + Without, + Changed, + With, ), >, ) { @@ -725,27 +725,23 @@ fn sync_config(config: Res) { pub struct CorePlugin; impl Plugin for CorePlugin { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { if !app.world().contains_resource::() { app.insert_resource(CoreConfig::default()); } app.register_type::() - .add_startup_system(setup.system()) + .add_startup_system(setup) .add_system_to_stage( CoreStage::PostUpdate, copy_coordinates_to_transform - .system() .before(TransformSystem::TransformPropagate), ) .add_system_to_stage( CoreStage::PostUpdate, - copy_rigid_body_position_to_coordinates.system(), + copy_rigid_body_position_to_coordinates, ) - .add_system_to_stage( - CoreStage::PostUpdate, - copy_collider_position_to_coordinates.system(), - ) - .add_system(sync_config.system()); + .add_system_to_stage(CoreStage::PostUpdate, copy_collider_position_to_coordinates) + .add_system(sync_config); } } diff --git a/src/error.rs b/src/error.rs index 4d2075a..b50606e 100644 --- a/src/error.rs +++ b/src/error.rs @@ -52,7 +52,7 @@ pub struct ErrorConfig { pub struct ErrorPlugin; impl Plugin for ErrorPlugin { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { init_panic_handler(); if let Some(config) = app.world().get_resource::() { if let Some(dsn) = &config.sentry_dsn { diff --git a/src/exploration.rs b/src/exploration.rs index 18febe8..148d240 100644 --- a/src/exploration.rs +++ b/src/exploration.rs @@ -15,16 +15,16 @@ use crate::{ visibility::{RevealedTiles, Viewshed, Visible, VisibleEntities}, }; -#[derive(Clone, Copy, Debug, Default, PartialEq, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, PartialEq, Reflect)] #[reflect(Component)] pub struct Explorable; -#[derive(Clone, Copy, Debug, Default, PartialEq, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, PartialEq, Reflect)] #[reflect(Component)] pub struct ExplorationFocused; #[allow(dead_code)] -#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Reflect)] +#[derive(Component, Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd, Reflect)] pub enum ExplorationType { Portal = 0, Item = 1, @@ -61,16 +61,16 @@ impl Into<&str> for ExplorationType { } } -#[derive(Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct Exploring(pub (f32, f32)); impl_pointlike_for_tuple_component!(Exploring); -#[derive(Clone, Debug, Default, Deref, DerefMut)] +#[derive(Component, Clone, Debug, Default, Deref, DerefMut)] pub struct FocusedExplorationType(pub Option); -#[derive(Clone, Copy, Debug, Default, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, Reflect)] #[reflect(Component)] pub struct Mappable; @@ -456,7 +456,7 @@ where A: Hash + Eq + Clone + Send + Sync, 'a: 'static, { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { if !app.world().contains_resource::>() { app.insert_resource(ExplorationConfig::::default()); } @@ -470,53 +470,29 @@ where .register_type::() .add_system_to_stage( CoreStage::PostUpdate, - exploration_changed_announcement - .system() - .chain(error_handler.system()), + exploration_changed_announcement.chain(error_handler), ); if config.exploration_control_states.is_empty() { - app.add_system(exploration_focus::.system()) - .add_system( - exploration_type_focus:: - .system() - .chain(error_handler.system()), - ) - .add_system( - exploration_type_change:: - .system() - .chain(error_handler.system()), - ) - .add_system(navigate_to_explored::.system()) + app.add_system(exploration_focus::) + .add_system(exploration_type_focus::.chain(error_handler)) + .add_system(exploration_type_change::.chain(error_handler)) + .add_system(navigate_to_explored::) .add_system_to_stage( CoreStage::PostUpdate, - exploration_type_changed_announcement - .system() - .chain(error_handler.system()), + exploration_type_changed_announcement.chain(error_handler), ); } else { let states = config.exploration_control_states; for state in states { app.add_system_set( SystemSet::on_update(state.clone()) - .with_system(exploration_focus::.system()) - .with_system( - exploration_type_focus:: - .system() - .chain(error_handler.system()), - ) - .with_system( - exploration_type_change:: - .system() - .chain(error_handler.system()), - ) - .with_system(navigate_to_explored::.system()) - .with_system( - exploration_type_changed_announcement - .system() - .chain(error_handler.system()), - ), + .with_system(exploration_focus::) + .with_system(exploration_type_focus::.chain(error_handler)) + .with_system(exploration_type_change::.chain(error_handler)) + .with_system(navigate_to_explored::) + .with_system(exploration_type_changed_announcement.chain(error_handler)), ) - .add_system_set(SystemSet::on_exit(state).with_system(cleanup.system())); + .add_system_set(SystemSet::on_exit(state).with_system(cleanup)); } } } diff --git a/src/log.rs b/src/log.rs index 4c70b68..a0a3323 100644 --- a/src/log.rs +++ b/src/log.rs @@ -6,7 +6,7 @@ use derive_more::{Deref, DerefMut}; use crate::error::error_handler; -#[derive(Clone, Debug, Default, Deref, DerefMut)] +#[derive(Component, Clone, Debug, Default, Deref, DerefMut)] pub struct Log(pub Vec); impl Log { @@ -18,7 +18,7 @@ impl Log { } } -#[derive(Clone, Debug)] +#[derive(Component, Clone, Debug)] pub struct LogEntry { pub time: Instant, pub message: String, @@ -47,10 +47,8 @@ fn read_log( pub struct LogPlugin; impl Plugin for LogPlugin { - fn build(&self, app: &mut AppBuilder) { - app.add_startup_system(setup.system()).add_system_to_stage( - CoreStage::PostUpdate, - read_log.system().chain(error_handler.system()), - ); + fn build(&self, app: &mut App) { + app.add_startup_system(setup) + .add_system_to_stage(CoreStage::PostUpdate, read_log.chain(error_handler)); } } diff --git a/src/map.rs b/src/map.rs index fdc65fa..fb914a6 100644 --- a/src/map.rs +++ b/src/map.rs @@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet}; use bevy::prelude::*; use bevy_rapier2d::prelude::*; use derive_more::{Deref, DerefMut}; -pub use mapgen::Map; +pub use mapgen::Map as MapgenMap; use mapgen::{geometry::Rect as MRect, MapFilter, Tile}; use maze_generator::{prelude::*, recursive_backtracking::RbGenerator}; use rand::prelude::StdRng; @@ -22,23 +22,27 @@ impl From for Coordinates { } } -#[derive(Clone, Debug, Default, Reflect)] +#[derive(Component, Clone, Debug, Default, Reflect)] #[reflect(Component)] pub struct Area; -#[derive(Clone, Debug, Default, Reflect)] +#[derive(Component, Clone, Debug, Default, Deref, DerefMut, Reflect)] +#[reflect(Component)] +pub struct Map(pub MapgenMap); + +#[derive(Component, Clone, Debug, Default, Reflect)] #[reflect(Component)] pub struct MapObstruction; -#[derive(Clone, Debug, Default, Reflect)] +#[derive(Component, Clone, Debug, Default, Reflect)] #[reflect(Component)] pub struct Portal; -#[derive(Clone, Debug, Default, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Debug, Default, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct SpawnColliderPerTile(pub bool); -#[derive(Clone, Debug, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Debug, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct SpawnColliders(pub bool); @@ -48,7 +52,7 @@ impl Default for SpawnColliders { } } -#[derive(Clone, Debug, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Debug, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct SpawnPortals(pub bool); @@ -417,7 +421,7 @@ fn spawn_portals( fn spawn_portal_colliders( mut commands: Commands, map: Query<(Entity, &SpawnColliders), With>, - portals: Query<(Entity, &Coordinates), Without>, + portals: Query<(Entity, &Coordinates), Without>, ) { for (map_entity, spawn_colliders) in map.iter() { if **spawn_colliders { @@ -479,17 +483,17 @@ fn area_description( pub struct MapPlugin; impl Plugin for MapPlugin { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { if !app.world().contains_resource::() { app.insert_resource(MapConfig::default()); } let config = app.world().get_resource::().unwrap().clone(); app.register_type::() - .add_system(spawn_colliders.system()) - .add_system(spawn_portals.system()) - .add_system(spawn_portal_colliders.system()); + .add_system(spawn_colliders) + .add_system(spawn_portals) + .add_system(spawn_portal_colliders); if config.speak_area_descriptions { - app.add_system_to_stage(CoreStage::PostUpdate, area_description.system()); + app.add_system_to_stage(CoreStage::PostUpdate, area_description); } } } diff --git a/src/navigation.rs b/src/navigation.rs index d8d94db..32c0efc 100644 --- a/src/navigation.rs +++ b/src/navigation.rs @@ -13,7 +13,7 @@ use crate::{ pathfinding::Destination, }; -#[derive(Clone, Copy, Debug, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Copy, Debug, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct MaxSpeed(pub f32); @@ -23,7 +23,7 @@ impl Default for MaxSpeed { } } -#[derive(Clone, Copy, Debug, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Copy, Debug, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct RotationSpeed(pub Angle); @@ -33,11 +33,11 @@ impl Default for RotationSpeed { } } -#[derive(Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct Speed(pub f32); -#[derive(Clone, Copy, Debug, Default, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, Reflect)] #[reflect(Component)] pub struct Sprinting; @@ -49,11 +49,11 @@ fn movement_controls( mut query: Query< ( Entity, - &mut RigidBodyVelocity, + &mut RigidBodyVelocityComponent, &mut Speed, &MaxSpeed, Option<&RotationSpeed>, - &mut RigidBodyPosition, + &mut RigidBodyPositionComponent, Option<&Destination>, ), With, @@ -202,7 +202,7 @@ fn speak_direction( Ok(()) } -fn remove_speed(removed: RemovedComponents, mut query: Query<&mut RigidBodyVelocity>) { +fn remove_speed(removed: RemovedComponents, mut query: Query<&mut RigidBodyVelocityComponent>) { for entity in removed.iter() { if let Ok(mut velocity) = query.get_mut(entity) { velocity.linvel = Vec2::ZERO.into(); @@ -259,7 +259,7 @@ where A: Hash + Eq + Clone + Send + Sync, 'a: 'static, { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { if !app.world().contains_resource::>() { app.insert_resource(NavigationConfig::::default()); } @@ -271,16 +271,16 @@ where app.register_type::() .register_type::() .register_type::() - .add_system(update_direction.system()) - .add_system(speak_direction.system().chain(error_handler.system())) - .add_system_to_stage(CoreStage::PostUpdate, remove_speed.system()); + .add_system(update_direction) + .add_system(speak_direction.chain(error_handler)) + .add_system_to_stage(CoreStage::PostUpdate, remove_speed); if config.movement_control_states.is_empty() { - app.add_system(movement_controls::.system()); + app.add_system(movement_controls::); } else { let states = config.movement_control_states; for state in states { app.add_system_set( - SystemSet::on_update(state).with_system(movement_controls::.system()), + SystemSet::on_update(state).with_system(movement_controls::), ); } } diff --git a/src/pathfinding.rs b/src/pathfinding.rs index ccaba42..934ad92 100644 --- a/src/pathfinding.rs +++ b/src/pathfinding.rs @@ -20,20 +20,20 @@ use crate::{ navigation::{RotationSpeed, Speed}, }; -#[derive(Debug, Deref, DerefMut)] +#[derive(Component, Debug, Deref, DerefMut)] struct Calculating(Task>); -#[derive(Clone, Copy, Debug, Default, Deref, DerefMut, Eq, Hash, PartialEq, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, Deref, DerefMut, Eq, Hash, PartialEq, Reflect)] #[reflect(Component)] pub struct Destination(pub (i32, i32)); impl_pointlike_for_tuple_component!(Destination); -#[derive(Clone, Debug, Default, Reflect)] +#[derive(Component, Clone, Debug, Default, Reflect)] #[reflect(Component)] pub struct NoPath; -#[derive(Clone, Debug, Default, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Debug, Default, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct Path(pub Vec<(i32, i32)>); @@ -62,15 +62,29 @@ struct StaticColliderComponentsSet( HashMap, ); -impl +impl<'world, 'state> From<( - &Query<'_, (Entity, &ColliderPosition, &SharedShape, &ColliderFlags)>, - &Query<'_, &MapObstruction>, + &Query< + 'world, + 'state, + ( + Entity, + &ColliderPositionComponent, + &ColliderShapeComponent, + &ColliderFlagsComponent, + ), + >, + &Query<'world, 'state, &MapObstruction>, )> for StaticColliderComponentsSet { fn from( query: ( - &Query<(Entity, &ColliderPosition, &SharedShape, &ColliderFlags)>, + &Query<( + Entity, + &ColliderPositionComponent, + &ColliderShapeComponent, + &ColliderFlagsComponent, + )>, &Query<&MapObstruction>, ), ) -> Self { @@ -188,7 +202,10 @@ fn calculate_path( query_pipeline: Res, obstructions: Query<&MapObstruction>, collider_query: QueryPipelineColliderComponentsQuery, - query: Query<(Entity, &Destination, &Coordinates, &ColliderShape), Changed>, + query: Query< + (Entity, &Destination, &Coordinates, &ColliderShapeComponent), + Changed, + >, map: Query<&Map>, ) { for (entity, destination, coordinates, shape) in query.iter() { @@ -253,8 +270,8 @@ fn negotiate_path( mut query: Query<( Entity, &mut Path, - &mut RigidBodyPosition, - &mut RigidBodyVelocity, + &mut RigidBodyPositionComponent, + &mut RigidBodyVelocityComponent, &Speed, Option<&RotationSpeed>, )>, @@ -312,11 +329,11 @@ fn remove_calculating( pub struct PathfindingPlugin; impl Plugin for PathfindingPlugin { - fn build(&self, app: &mut AppBuilder) { - app.add_system(calculate_path.system()) - .add_system_to_stage(CoreStage::PostUpdate, remove_destination.system()) - .add_system(poll_tasks.system()) - .add_system(negotiate_path.system()) - .add_system_to_stage(CoreStage::PostUpdate, remove_calculating.system()); + fn build(&self, app: &mut App) { + app.add_system(calculate_path) + .add_system_to_stage(CoreStage::PostUpdate, remove_destination) + .add_system(poll_tasks) + .add_system(negotiate_path) + .add_system_to_stage(CoreStage::PostUpdate, remove_calculating); } } diff --git a/src/sound.rs b/src/sound.rs index 2160423..515825b 100644 --- a/src/sound.rs +++ b/src/sound.rs @@ -11,7 +11,7 @@ use crate::{ visibility::{Viewshed, VisibleEntities}, }; -#[derive(Clone, Debug, Reflect)] +#[derive(Component, Clone, Debug, Reflect)] #[reflect(Component)] pub struct Footstep { pub sound: HandleId, @@ -39,7 +39,7 @@ impl Default for Footstep { } } -#[derive(Clone, Debug)] +#[derive(Component, Clone, Debug)] pub struct SoundIcon { pub sound: HandleId, pub gain: f32, @@ -284,7 +284,7 @@ where S: bevy::ecs::component::Component + Clone + Debug + Eq + Hash, 'a: 'static, { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { if !app.world().contains_resource::>() { app.insert_resource(SoundConfig::::default()); } @@ -296,17 +296,15 @@ where .unwrap(); } app.register_type::() - .add_system(add_footstep_sounds.system()) + .add_system(add_footstep_sounds) .add_system_to_stage( CoreStage::PostUpdate, - footstep.system().after(TransformSystem::TransformPropagate), + footstep.after(TransformSystem::TransformPropagate), ) - .add_system(add_sound_icon_sounds.system()) + .add_system(add_sound_icon_sounds) .add_system_to_stage( CoreStage::PostUpdate, - sound_icon:: - .system() - .after(TransformSystem::TransformPropagate), + sound_icon::.after(TransformSystem::TransformPropagate), ) .add_stage_after( CoreStage::PostUpdate, @@ -315,12 +313,12 @@ where ) .add_system_to_stage( SOUND_ICON_AND_EXPLORATION_STAGE, - sound_icon_exploration_focus_changed.system(), + sound_icon_exploration_focus_changed, ) .add_system_to_stage( SOUND_ICON_AND_EXPLORATION_STAGE, - sound_icon_exploration_focus_removed.system(), + sound_icon_exploration_focus_removed, ) - .add_system(scale_sounds.system()); + .add_system(scale_sounds); } } diff --git a/src/visibility.rs b/src/visibility.rs index d651b7a..984f006 100644 --- a/src/visibility.rs +++ b/src/visibility.rs @@ -17,15 +17,15 @@ use crate::{ utils::target_and_other, }; -#[derive(Clone, Copy, Debug, Default, Reflect)] +#[derive(Component, Clone, Copy, Debug, Default, Reflect)] #[reflect(Component)] pub struct DontLogWhenVisible; -#[derive(Clone, Debug, Default, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Debug, Default, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct RevealedTiles(pub Vec); -#[derive(Clone, Debug, Eq, PartialEq)] +#[derive(Component, Clone, Debug, Eq, PartialEq)] pub struct Viewshed { pub range: u32, pub visible_points: HashSet<(i32, i32)>, @@ -139,7 +139,7 @@ impl Viewshed { } } -#[derive(Clone, Copy, Debug, Deref, DerefMut, Reflect)] +#[derive(Component, Clone, Copy, Debug, Deref, DerefMut, Reflect)] #[reflect(Component)] pub struct Visible(pub u8); @@ -159,7 +159,7 @@ impl Visible { } } -#[derive(Clone, Debug, Default, Deref, DerefMut)] +#[derive(Component, Clone, Debug, Default, Deref, DerefMut)] pub struct VisibleEntities(HashSet); #[derive(Bundle, Default)] @@ -356,7 +356,7 @@ fn log_visible( mut log: Query<&mut Log>, viewers: Query<(Entity, &Coordinates, &Transform), (With, With)>, visible: Query< - (&Name, Option<&RigidBodyPosition>, Option<&ColliderPosition>), + (&Name, Option<&RigidBodyPositionComponent>, Option<&ColliderPositionComponent>), Without, >, ) { @@ -402,17 +402,17 @@ pub const LOG_VISIBLE_LABEL: &str = "LOG_VISIBLE"; pub struct VisibilityPlugin; impl Plugin for VisibilityPlugin { - fn build(&self, app: &mut AppBuilder) { + fn build(&self, app: &mut App) { app.add_event::() - .add_system(add_visibility_indices.system()) - .add_system_to_stage(CoreStage::PostUpdate, viewshed_removed.system()) + .add_system(add_visibility_indices) + .add_system_to_stage(CoreStage::PostUpdate, viewshed_removed) .add_system_set( SystemSet::new() .with_run_criteria(FixedTimestep::step(0.1)) - .with_system(update_viewshed.system()), + .with_system(update_viewshed), ) - .add_system_to_stage(CoreStage::PostUpdate, remove_visible.system()) - .add_system_to_stage(CoreStage::PostUpdate, update_revealed_tiles.system()) - .add_system_to_stage(CoreStage::PostUpdate, log_visible.system()); + .add_system_to_stage(CoreStage::PostUpdate, remove_visible) + .add_system_to_stage(CoreStage::PostUpdate, update_revealed_tiles) + .add_system_to_stage(CoreStage::PostUpdate, log_visible); } }