bevy/crates/bevy_ecs/src/system
JoJoJet 5472ea4a14
Improve encapsulation for commands and add docs (#8725)
# Objective

Several of our built-in `Command` types are too public:
- `GetOrSpawn` is public, even though it only makes sense to call it
from within `Commands::get_or_spawn`.
- `Remove` and `RemoveResource` contain public `PhantomData` marker
fields.

## Solution

Remove `GetOrSpawn` and use an anonymous command. Make the marker fields
private.

---

## Migration Guide

The `Command` types `Remove` and `RemoveResource` may no longer be
constructed manually.

```rust
// Before:
commands.add(Remove::<T> {
    entity: id,
    phantom: PhantomData,
});

// After:
commands.add(Remove::<T>::new(id));

// Before:
commands.add(RemoveResource::<T> { phantom: PhantomData });

// After:
commands.add(RemoveResource::<T>::new());
```

The command type `GetOrSpawn` has been removed. It was not possible to
use this type outside of `bevy_ecs`.
2023-05-31 16:45:46 +00:00
..
commands Improve encapsulation for commands and add docs (#8725) 2023-05-31 16:45:46 +00:00
combinator.rs Improve safety for the multi-threaded executor using UnsafeWorldCell (#8292) 2023-05-29 15:22:10 +00:00
exclusive_function_system.rs Improve safety for the multi-threaded executor using UnsafeWorldCell (#8292) 2023-05-29 15:22:10 +00:00
exclusive_system_param.rs implement TypeUuid for primitives and fix multiple-parameter generics having the same TypeUuid (#6633) 2023-02-16 17:09:44 +00:00
function_system.rs Improve safety for the multi-threaded executor using UnsafeWorldCell (#8292) 2023-05-29 15:22:10 +00:00
mod.rs Improve safety for the multi-threaded executor using UnsafeWorldCell (#8292) 2023-05-29 15:22:10 +00:00
query.rs Document query errors (#8692) 2023-05-30 14:41:14 +00:00
system.rs Improve safety for the multi-threaded executor using UnsafeWorldCell (#8292) 2023-05-29 15:22:10 +00:00
system_param.rs Use UnsafeWorldCell to increase code quality for SystemParam (#8174) 2023-04-01 15:45:07 +00:00