Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Improve bevy_ecs and bevy_app API docs where referenced by the new Bevy Book #2365

Closed
wants to merge 151 commits into from
Closed
Changes from 4 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
4d1040a
Improve App docs
Nilirad Jun 20, 2021
54954bc
Move App doc example to AppBuilder
Nilirad Jun 20, 2021
6db1fce
Document App methods
Nilirad Jun 20, 2021
b7436de
Restore App example to original position
Nilirad Jun 20, 2021
71f4541
Clarify App::update method doc comment
Nilirad Jun 20, 2021
62258d4
Document AppBuilder fns and some relative items
Nilirad Jun 22, 2021
3d34f02
Add StartupStage enum link to add_default_stages
Nilirad Jun 23, 2021
ba27b4f
Correct enum keyword monospace text
Nilirad Jun 23, 2021
862ccb3
Add docs for mod system
Nilirad Jun 23, 2021
cfe0755
Point stage links to add_default_stages
Nilirad Jun 23, 2021
043b31a
Merge branch 'main' into api-docs-ch1
Nilirad Jun 23, 2021
c1fc50b
Update crates/bevy_ecs/src/system/mod.rs
Nilirad Jun 24, 2021
f29e769
Correct add_startup_system_to_stage docs
Nilirad Jun 24, 2021
7c66d20
Document new AppBuilder methods
Nilirad Jun 24, 2021
3f9d879
Remove incorrect references to StartupStage
Nilirad Jun 24, 2021
483f312
Add module-level documentation for entity
Nilirad Jun 25, 2021
dad4c5e
Improve sentence wording
Nilirad Jun 25, 2021
c693223
Query module-level documentation
Nilirad Jun 26, 2021
ac52aa3
Remove duplicate info on resource init methods
Nilirad Jun 26, 2021
2cc360c
Refactor Query docs in a more structured way
Nilirad Jun 26, 2021
16f9a87
Add `Added` and `Changed` filters
Nilirad Jun 26, 2021
307ea91
Add link to Query in mod query docs
Nilirad Jun 26, 2021
348985f
Add query iteration docs
Nilirad Jun 26, 2021
5676e45
FIx doctests
Nilirad Jun 26, 2021
7e11aa1
Fix link to Query
Nilirad Jun 26, 2021
2f8f7f9
Add list of system parameters
Nilirad Jun 27, 2021
94fee6c
Improve add_default_stages wording
Nilirad Jun 28, 2021
78ce084
Improve add_default_stages wording
Nilirad Jun 28, 2021
8f34675
Add Optional (Non)Send SystemParams
Nilirad Jun 28, 2021
7945a66
Merge branch 'main' into api-docs-ch1
Nilirad Jun 28, 2021
eaa4e72
Add SystemParam requirement
Nilirad Jul 2, 2021
f13dcb5
Add Schedule struct and module documentation
Nilirad Jul 2, 2021
d517f57
Link to Stage
Nilirad Jul 2, 2021
083adf0
Add brief description of Stage trait
Nilirad Jul 2, 2021
7610e8b
Add crate general info and module summaries
Nilirad Jul 4, 2021
bafbda6
Improve resource documentation
Nilirad Jul 4, 2021
a72840b
Merge branch 'bevyengine:main' into api-docs-ch1
Nilirad Jul 4, 2021
ba506b9
Yeet .system() from resource doctest
Nilirad Jul 5, 2021
132043e
Remove unnecessary comma
Nilirad Jul 5, 2021
54aa4ef
Improve Bundle docs
Nilirad Jul 5, 2021
c7cdfd0
Add dash in ECS-based
Nilirad Jul 6, 2021
79ce84d
Fix grammar
Nilirad Jul 6, 2021
8b16e36
Improve WithBundle docs
Nilirad Jul 6, 2021
70373f7
Improve sentence conciseness
Nilirad Jul 6, 2021
58e1d30
Improve entity use-case list order
Nilirad Jul 6, 2021
2a9369a
Improve grammar
Nilirad Jul 6, 2021
681e2e9
Improve grammar
Nilirad Jul 6, 2021
5b8c8e9
Improve query filter list header
Nilirad Jul 6, 2021
0e1328d
Improve App::run docs
Nilirad Jul 6, 2021
5600265
Describe default behavior of init_resource
Nilirad Jul 6, 2021
db34dd4
Specify that Schedule stages run in linear order
Nilirad Jul 6, 2021
0aa09d7
uwu
Nilirad Jul 6, 2021
647c322
Invert sentence for query single component access
Nilirad Jul 7, 2021
5363519
Add multiple query filters example
Nilirad Jul 7, 2021
cc92352
Change Schedule to Stage in schedule mod docs
Nilirad Jul 7, 2021
5fa6f0a
Separate resource from Component
Nilirad Jul 7, 2021
4856db0
Merge branch 'bevyengine:main' into api-docs-ch1
Nilirad Jul 7, 2021
171b0a2
Add usefulness of nested Schedules
Nilirad Jul 8, 2021
26794d9
Merge branch 'api-docs-ch1' of github.com:Nilirad/bevy into api-docs-ch1
Nilirad Jul 8, 2021
84e78f2
Change "update" to "my_stage" in example
Nilirad Jul 8, 2021
549db69
Enumerate default stages
Nilirad Jul 8, 2021
565a69a
Correct concurrent mutable component access
Nilirad Jul 8, 2021
a9bc51e
Fix typo
Nilirad Jul 11, 2021
2eb507a
Correct query concurrent mutable access
Nilirad Jul 11, 2021
0026994
Clarify use of `func` parameter
Nilirad Jul 11, 2021
bf94f67
Update query mutable component access descriptions
Nilirad Jul 11, 2021
9059588
Update mod system docs
Nilirad Jul 15, 2021
9d334e8
Add examples to AppBuilder methods
Nilirad Jul 15, 2021
ef830b6
Merge branch 'bevyengine:main' into api-docs-ch1
Nilirad Jul 16, 2021
696bbb4
Fix scheduler typo
Nilirad Jul 16, 2021
76ab530
Improve query result usage
Nilirad Jul 16, 2021
a705bfe
Remove code block for type parameters of Query
Nilirad Jul 16, 2021
9bb6e1c
Use a more specific Query summary description
Nilirad Jul 16, 2021
9482315
Define "query result"
Nilirad Jul 16, 2021
86dd7f7
Avoid using "contemporarily"
Nilirad Jul 16, 2021
eea7f53
Query system parameter usage intro
Nilirad Jul 16, 2021
20581b7
Merge branch 'api-docs-ch1' of github.com:Nilirad/bevy into api-docs-ch1
Nilirad Jul 16, 2021
fc52b1b
Add examples to Query iter and iter_mut methods
Nilirad Jul 16, 2021
6254589
Remove Res<Time> from Query::iter_mut example
Nilirad Jul 17, 2021
293702d
Fix mod system doctest
Nilirad Jul 17, 2021
7b2a818
General Query docs improvements
Nilirad Jul 17, 2021
5d15897
Add Query methods docs
Nilirad Jul 17, 2021
4ac95eb
Improve wording
Nilirad Jul 17, 2021
8972641
Add example to Query::get
Nilirad Jul 17, 2021
865d722
Rename Target to Winner
Nilirad Jul 18, 2021
9319ced
Rename Target to Winner, part 2
Nilirad Jul 18, 2021
4594d13
Add third person "s" verb suffix
Nilirad Jul 18, 2021
933cc9f
Add Query::get_component example
Nilirad Jul 18, 2021
0bdc8ab
Use a more concise example for Query::get
Nilirad Jul 18, 2021
57333e0
Add example to Query::get_component_mut
Nilirad Jul 18, 2021
6c82809
Add example for Query::get_mut
Nilirad Jul 18, 2021
14155ce
Add .system() to check examples' SystemParams
Nilirad Jul 18, 2021
33c8a1c
Add example to Query::is_empty
Nilirad Jul 18, 2021
c68dd21
Update examples for Query::{single, single_mut}
Nilirad Jul 18, 2021
d88b46a
Query: use "Returns" instead of "Gets"
Nilirad Jul 18, 2021
c0eddb6
Add error case info for Query methods
Nilirad Jul 18, 2021
b7ae0c7
Link to `SystemParam`
Nilirad Jul 21, 2021
96a63aa
Add metadata notes to some `SystemParam`s in list
Nilirad Jul 21, 2021
8c66a92
Improve `WithBundle` summary
Nilirad Jul 21, 2021
f3cedeb
Listify safety notes for `Bundle`
Nilirad Jul 21, 2021
eda2f90
Reference example on top for `AppBuilder::run`
Nilirad Jul 21, 2021
788a817
Improve wording
Nilirad Jul 21, 2021
358f825
Remove "most relevant"
Nilirad Jul 21, 2021
7d3d8ce
Expand mutable query guidelines
Nilirad Jul 21, 2021
8a4c679
Remove empty code block
Nilirad Jul 23, 2021
5bd7d6a
Merge branch 'api-docs-ch1' of github.com:Nilirad/bevy into api-docs-ch1
Nilirad Jul 23, 2021
26aaade
Add `Commands` method examples
Nilirad Jul 24, 2021
3372b7b
Add `EntityCommands` method examples
Nilirad Jul 25, 2021
fad5a32
hi
Nilirad Jul 25, 2021
208377e
Merge branch 'main' of https://github.com/bevyengine/bevy into bevyen…
Nilirad Jul 25, 2021
b9b33b5
Merge branch 'bevyengine-main' into api-docs-ch1
Nilirad Jul 25, 2021
e2bea20
Apply suggestions
Nilirad Jul 26, 2021
6395011
Misc improvements
Nilirad Jul 26, 2021
230eff1
Merge branch 'bevyengine:main' into api-docs-ch1
Nilirad Jul 27, 2021
34b68b3
Update `WithBundle` description
Nilirad Jul 27, 2021
50fb8c9
Resolve conflicts caused by app_builder.rs removal
Nilirad Jul 28, 2021
0501747
Merge branch 'bevyengine-main' into api-docs-ch1
Nilirad Jul 28, 2021
ad87266
Fix doctests and remove refs to `AppBuilder`
Nilirad Jul 28, 2021
85caa4b
Resolve merge conflicts
Nilirad Aug 1, 2021
3d9a857
Merge branch 'bevyengine-main' into api-docs-ch1
Nilirad Aug 1, 2021
090e923
Add examples to `Schedule` methods
Nilirad Aug 1, 2021
779e983
Include `REAME.md` as `bevy_ecs` crate level docs
Nilirad Aug 1, 2021
32c20be
Remove newline
Nilirad Aug 1, 2021
de82c53
return -> yield
Nilirad Aug 1, 2021
acaefb4
Style
Nilirad Aug 1, 2021
61395f7
Entity: handle -> ID
Nilirad Aug 1, 2021
bdfe0c2
Entity ID
Nilirad Aug 1, 2021
cd2b9ba
Add context to some `Query` method examples
Nilirad Aug 1, 2021
6d30e1d
wow
Nilirad Aug 1, 2021
4d39725
Unit `Bundle` is not a thing
Nilirad Aug 1, 2021
e9b22fa
Correct mod `archetype` summary
Nilirad Aug 1, 2021
8ebf116
Remove indent for code surrounded by hidden code
Nilirad Aug 1, 2021
5e1bac1
README docs breaks doctest suite
Nilirad Aug 1, 2021
b490df7
Apply suggestion
Nilirad Aug 1, 2021
bc6ef67
Unit `Bundle` is actually a thing
Nilirad Aug 1, 2021
ebbc6d2
Add newline after //! blocks on top of files
Nilirad Aug 1, 2021
96ff662
Remove ECS crate level docs as done by #2575
Nilirad Aug 7, 2021
50578d7
Add brief crate summary doc comment for `bevy_app`
Nilirad Aug 7, 2021
637beb0
Merge branch 'main' of https://github.com/bevyengine/bevy into bevyen…
Nilirad Aug 18, 2021
109c08f
Remove references to removed `WithBundle` filter
Nilirad Aug 18, 2021
762be6c
Merge branch 'bevyengine-main' into api-docs-ch1
Nilirad Aug 18, 2021
0136659
Merge branch 'main' into api-docs-ch1
Nilirad Aug 27, 2021
b5bb71a
Merge branch 'bevyengine:main' into api-docs-ch1
Nilirad Sep 5, 2021
1e6a53e
Resolve merge conflicts
Nilirad Sep 13, 2021
0997fe4
Merge branch 'bevyengine-main' into api-docs-ch1
Nilirad Sep 13, 2021
d740a96
fix
Nilirad Sep 13, 2021
757aa22
Fix doc warnings
Nilirad Sep 14, 2021
37b5b40
Resolve merge conflicts
Nilirad Sep 15, 2021
49f8e3d
Merge branch 'bevyengine-main' into api-docs-ch1
Nilirad Sep 15, 2021
f0ef44c
Apply review suggestions, part 1
Nilirad Sep 17, 2021
4c88e01
Move `.spawn().insert_bundle` alternative to `spawn`
Nilirad Sep 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ use bevy_utils::tracing::info_span;
#[allow(clippy::needless_doctest_main)]
/// Containers of app logic and data
///
/// App store the ECS World, Resources, Schedule, and Executor. They also store the "run" function
/// of the App, which by default executes the App schedule once. Apps are constructed using the
/// builder pattern.
/// Bundles together the necessary elements, like [`World`] and [`Schedule`], to create
/// an ECS based application. It also stores a pointer to a
Nilirad marked this conversation as resolved.
Show resolved Hide resolved
/// [runner function](AppBuilder::set_runner), which by default executes the App schedule
/// once. Apps are constructed with the builder pattern, using the [`AppBuilder`] struct.
///
/// ## Example
/// Here is a simple "Hello World" Bevy app:
Expand Down Expand Up @@ -50,10 +51,13 @@ fn run_once(mut app: App) {
}

impl App {
/// Returns an [`AppBuilder`] with a basic structure that can be configured further
/// to create an `App`.
pub fn build() -> AppBuilder {
AppBuilder::default()
}

/// Updates the [`Schedule`] of the `App`.
Nilirad marked this conversation as resolved.
Show resolved Hide resolved
pub fn update(&mut self) {
#[cfg(feature = "trace")]
let bevy_frame_update_span = info_span!("frame");
Expand All @@ -62,6 +66,7 @@ impl App {
self.schedule.run(&mut self.world);
}

/// Calls the runner function of the `App`.
Nilirad marked this conversation as resolved.
Show resolved Hide resolved
pub fn run(mut self) {
#[cfg(feature = "trace")]
let bevy_app_run_span = info_span!("bevy_app");
Expand Down