bevy/crates/bevy_ecs/src
Zeenobit 7d816aab04
Fix inconsistency between Debug and serialized representation of Entity (#12469)
# Objective

Fixes #12139 

## Solution

- Derive `Debug` impl for `Entity`
- Add impl `Display` for `Entity`
- Add `entity_display` test to check the output contains all required
info

I decided to go with `0v0|1234` format as opposed to the `0v0[1234]`
which was initially discussed in the issue.

My rationale for this is that `[1234]` may be confused for index values,
which may be common in logs, and so searching for entities by text would
become harder. I figured `|1234` would help the entity IDs stand out
more.

Additionally, I'm a little concerned that this change is gonna break
existing logging for projects because `Debug` is now going to be a
multi-line output. But maybe this is ok.

We could implement `Debug` to be a single-line output, but then I don't
see why it would be different from `Display` at all.

@alice-i-cecile Let me know if we'd like to make any changes based on
these points.
2024-03-14 14:57:22 +00:00
..
entity Fix inconsistency between Debug and serialized representation of Entity (#12469) 2024-03-14 14:57:22 +00:00
identifier fix some typos (#12038) 2024-02-22 18:55:22 +00:00
query Make a note about the performance of Query::is_empty (#12466) 2024-03-14 01:36:03 +00:00
reflect Move commands module into bevy::ecs::world (#12234) 2024-03-02 23:13:45 +00:00
schedule Simplified backtraces (#12305) 2024-03-10 12:18:59 +00:00
storage Use NonMaxUsize for non-component SparseSets (#12083) 2024-03-03 14:55:27 +00:00
system Make a note about the performance of Query::is_empty (#12466) 2024-03-14 01:36:03 +00:00
world Remove initialize_resource<T> and friends (#12307) 2024-03-05 16:09:13 +00:00
archetype.rs Query Joins (#11535) 2024-03-11 19:07:36 +00:00
bundle.rs Clean up pointer use in BundleSpawner/BundleInserter (#12269) 2024-03-06 05:52:18 +00:00
change_detection.rs Implement MutUntyped::from(mut_typed) (#12406) 2024-03-10 12:46:50 +00:00
component.rs Remove ComponentStorage and associated types (#12311) 2024-03-05 15:54:52 +00:00
event.rs Fix bug where events are not being dropped (#11528) 2024-02-02 21:14:54 +00:00
lib.rs Add "all-features = true" to docs.rs metadata for most crates (#12366) 2024-03-08 20:03:09 +00:00
removal_detection.rs Docs reflect that RemovalDetection also yields despawned entities (#11795) 2024-02-10 11:18:05 +00:00