Moar doc fixes

This commit is contained in:
Tim Blackbird 2025-07-17 16:51:27 +02:00
parent 1b1283a6f8
commit 21602eab7f
2 changed files with 3 additions and 10 deletions

View File

@ -57,7 +57,7 @@ pub trait Event: Send + Sync + 'static {
/// An [`Event`] without an entity target.
///
/// [`BroadcastEvent`]s can be triggered on a [`World`] with the method [`trigger`](World::trigger),
/// causing any [`Observer`] watching the event for those entities to run.
/// causing any global [`Observer`]s for that event to run.
///
/// # Usage
///
@ -106,9 +106,6 @@ pub trait Event: Send + Sync + 'static {
/// });
/// ```
///
/// For events that additionally need entity targeting or buffering, consider also deriving
/// [`EntityEvent`] or [`BufferedEvent`], respectively.
///
/// [`Observer`]: crate::observer::Observer
pub trait BroadcastEvent: Event {}
@ -126,7 +123,7 @@ pub trait BroadcastEvent: Event {}
///
/// # Usage
///
/// The [`EntityEvent`] trait can be derived. The `event` attribute can be used to further configure
/// The [`EntityEvent`] trait can be derived. The `entity_event` attribute can be used to further configure
/// the propagation behavior: adding `auto_propagate` sets [`EntityEvent::AUTO_PROPAGATE`] to `true`,
/// while adding `traversal = X` sets [`EntityEvent::Traversal`] to be of type `X`.
///

View File

@ -1,11 +1,7 @@
//! Events are things that "happen" and can be processed by app logic.
//!
//! [Event]s can be triggered on a [`World`](bevy_ecs::world::World) using a method like [`trigger`],
//! causing any global [`Observer`] watching that event to run. This allows for push-based
//! event handling where observers are immediately notified of events as they happen.
//!
//! - [`Event`]: A supertrait for push-based events that trigger global observers added via [`add_observer`].
//! - [`BroadcastEvent`]: An event without an entity target. Can be used via [`trigger`]
//! - [`BroadcastEvent`]: An event without an entity target. Can be used via [`trigger`].
//! - [`EntityEvent`]: An event targeting specific entities, triggering any observers watching those targets. Can be used via [`trigger_targets`].
//! They can trigger entity-specific observers added via [`observe`] and can be propagated from one entity to another.
//! - [`BufferedEvent`]: Support a pull-based event handling system where events are written using an [`EventWriter`]