Skip to content

Commit

Permalink
Rephrase comment about Local<T> for clarity. (Adopted) (bevyengine#11129
Browse files Browse the repository at this point in the history
)

# Objective

- Finish PR bevyengine#10322

## Solution

- Rebase changes in PR bevyengine#10322 and format the changes.

Co-authored-by: Mauer-Oats <maueroats@users.noreply.github.com>
  • Loading branch information
2 people authored and tjamaan committed Feb 6, 2024
1 parent 065cb0f commit 4b717c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/ecs/ecs_guide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ fn exclusive_player_system(world: &mut World) {
}

// Sometimes systems need to be stateful. Bevy's ECS provides the `Local` system parameter
// for this case. A `Local<T>` refers to a value owned by the system of type `T`, which is automatically
// initialized using `T`'s `FromWorld`* implementation. In this system's `Local` (`counter`), `T` is `u32`.
// for this case. A `Local<T>` refers to a value of type `T` that is owned by the system.
// This value is automatically initialized using `T`'s `FromWorld`* implementation upon the system's initialization upon the system's initialization.
// In this system's `Local` (`counter`), `T` is `u32`.
// Therefore, on the first turn, `counter` has a value of 0.
//
// *: `FromWorld` is a trait which creates a value using the contents of the `World`.
Expand Down

0 comments on commit 4b717c1

Please sign in to comment.