bevy/crates/bevy_ecs/src/schedule
Doonv ba0f8f996f
Add insert_state to App. (#11043)
# Objective

Fix #10731.

## Solution

Rename `App::add_state<T>(&mut self)` to `init_state`, and add
`App::insert_state<T>(&mut self, state: T)`. I decided on these names
because they are more similar to `init_resource` and `insert_resource`.

I also removed the `States` trait's requirement for `Default`. Instead,
`init_state` requires `FromWorld`.

---

## Changelog

- Renamed `App::add_state` to `init_state`.
- Added `App::insert_state`.
- Removed the `States` trait's requirement for `Default`.

## Migration Guide

- Renamed `App::add_state` to `init_state`.
2023-12-21 14:09:24 +00:00
..
executor Reorder impl to be the same as the trait (#10964) 2023-12-13 21:19:49 +00:00
condition.rs Remove unnecessary path prefixes (#10749) 2023-11-28 23:43:40 +00:00
config.rs Auto insert sync points (#9822) 2023-12-14 16:34:01 +00:00
graph_utils.rs Auto insert sync points (#9822) 2023-12-14 16:34:01 +00:00
mod.rs Simplify equality assertions (#10988) 2023-12-16 23:58:41 +00:00
schedule.rs Remove unnecessary parentheses (#10990) 2023-12-16 02:26:18 +00:00
set.rs Reorder impl to be the same as the trait (#10964) 2023-12-13 21:19:49 +00:00
state.rs Add insert_state to App. (#11043) 2023-12-21 14:09:24 +00:00