From 93245c136ec3faf4223ad5a190b354ea10b571b7 Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 28 Oct 2025 21:55:27 +0100 Subject: [PATCH] Reorganize common exports into `prelude` module --- client/src/block_assets.rs | 4 +--- client/src/camera.rs | 3 ++- client/src/main.rs | 4 ++-- client/src/placement.rs | 4 ++-- common/src/lib.rs | 8 ++++++++ 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/client/src/block_assets.rs b/client/src/block_assets.rs index e1f3b7e..82ab4b2 100644 --- a/client/src/block_assets.rs +++ b/client/src/block_assets.rs @@ -1,7 +1,5 @@ use bevy::prelude::*; - -use common::asset_loading::LoadResource; -use common::block::Block; +use common::prelude::*; pub fn plugin(app: &mut App) { app.add_observer(insert_block_visuals); diff --git a/client/src/camera.rs b/client/src/camera.rs index 5872923..b3c6f35 100644 --- a/client/src/camera.rs +++ b/client/src/camera.rs @@ -1,7 +1,8 @@ use std::f32::consts::TAU; -use bevy::input::mouse::AccumulatedMouseMotion; use bevy::prelude::*; + +use bevy::input::mouse::AccumulatedMouseMotion; use bevy::window::{CursorGrabMode, CursorOptions}; pub fn cursor_grab( diff --git a/client/src/main.rs b/client/src/main.rs index 99361b4..e6e760e 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -1,9 +1,9 @@ use bevy::prelude::*; -use common::network::*; +use common::prelude::network::*; +use common::prelude::*; use bevy::asset::AssetMetaCheck; use bevy::window::WindowResolution; -use common::block::Blocks; use lightyear::prelude::server::Started; mod args; diff --git a/client/src/placement.rs b/client/src/placement.rs index 8a9538a..d093a9b 100644 --- a/client/src/placement.rs +++ b/client/src/placement.rs @@ -1,7 +1,7 @@ use bevy::prelude::*; -use bevy::window::{CursorGrabMode, CursorOptions}; +use common::prelude::*; -use common::block::Blocks; +use bevy::window::{CursorGrabMode, CursorOptions}; // TODO: Use picking system instead of manually raycasting. diff --git a/common/src/lib.rs b/common/src/lib.rs index 69000e3..5c91849 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,3 +1,11 @@ pub mod asset_loading; pub mod block; pub mod network; + +// This is mostly just re-exportings things for now, but in the future +// we might want to limit what gets exposed by the `prelude` module. +pub mod prelude { + pub use super::asset_loading::LoadResource; + pub use super::block::*; + pub use super::network; +}