bevy/crates/bevy_ecs/src
Mike 33fdc5f5db
Move schedule name into Schedule (#9600)
# Objective

- Move schedule name into `Schedule` to allow the schedule name to be
used for errors and tracing in Schedule methods
- Fixes #9510

## Solution

- Move label onto `Schedule` and adjust api's on `World` and `Schedule`
to not pass explicit label where it makes sense to.
- add name to errors and tracing.
- `Schedule::new` now takes a label so either add the label or use
`Schedule::default` which uses a default label. `default` is mostly used
in doc examples and tests.

---

## Changelog

- move label onto `Schedule` to improve error message and logging for
schedules.

## Migration Guide

`Schedule::new` and `App::add_schedule`
```rust
// old
let schedule = Schedule::new();
app.add_schedule(MyLabel, schedule);

// new
let schedule = Schedule::new(MyLabel);
app.add_schedule(schedule);
```

if you aren't using a label and are using the schedule struct directly
you can use the default constructor.
```rust
// old
let schedule = Schedule::new();
schedule.run(world);

// new
let schedule = Schedule::default();
schedule.run(world);
```

`Schedules:insert`
```rust
// old
let schedule = Schedule::new();
schedules.insert(MyLabel, schedule);

// new
let schedule = Schedule::new(MyLabel);
schedules.insert(schedule);
```

`World::add_schedule`
```rust
// old
let schedule = Schedule::new();
world.add_schedule(MyLabel, schedule);

// new
let schedule = Schedule::new(MyLabel);
world.add_schedule(schedule);
```
2023-08-28 20:44:48 +00:00
..
entity Replaced EntityMap with HashMap (#9461) 2023-08-28 17:18:16 +00:00
query Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
reflect implement insert and remove reflected entity commands (#8895) 2023-08-28 18:21:20 +00:00
schedule Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
storage Fix typos throughout the project (#9090) 2023-07-10 00:11:51 +00:00
system Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
world Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
archetype.rs Fix typo in Archetypes documentation (#8990) 2023-06-28 19:33:18 +00:00
bundle.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
change_detection.rs Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
component.rs Derive Eq, PartialEq for Tick (#9020) 2023-07-04 19:08:51 +00:00
event.rs Move schedule name into Schedule (#9600) 2023-08-28 20:44:48 +00:00
lib.rs Add system.map(...) for transforming the output of a system (#8526) 2023-08-28 16:36:46 +00:00
removal_detection.rs Rename ManualEventIterator (#9592) 2023-08-28 17:49:25 +00:00