bevy/examples/games
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
..
alien_cake_addict.rs Add insert_state to App. (#11043) 2023-12-21 14:09:24 +00:00
breakout.rs Update winit dependency to 0.29 (#10702) 2023-12-21 07:40:47 +00:00
contributors.rs Update default ClearColor to better match Bevy's branding (#10339) 2023-11-03 12:57:38 +00:00
game_menu.rs Add insert_state to App. (#11043) 2023-12-21 14:09:24 +00:00