You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
This is the first step of #19430 and is a follow up for #19132.
Now that `ArchetypeRow` has a niche, we can use `Option` instead of
needing `INVALID` everywhere.
This was especially concerning since `INVALID` *really was valid!*
Using options here made the code clearer and more data-driven.
## Solution
Replace all uses of `INVALID` entity locations (and archetype/table
rows) with `None`.
## Testing
CI
---------
Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com>
Co-authored-by: François Mockers <francois.mockers@vleue.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
/// An [`Entity`] id may or may not correspond to a valid conceptual entity.
1321
+
/// If it does, the conceptual entity may or may not have a location.
1322
+
/// If it has no location, the [`EntityLocation`] will be `None`.
1323
+
/// An location of `None` means the entity effectively does not exist; it has an id, but is not participating in the ECS.
1324
+
/// This is different from a location in the empty archetype, which is participating (queryable, etc) but just happens to have no components.
1325
+
///
1326
+
/// Setting a location to `None` is often helpful when you want to destruct an entity or yank it from the ECS without allowing another system to reuse the id for something else.
1327
+
/// It is also useful for reserving an id; commands will often allocate an `Entity` but not provide it a location until the command is applied.
0 commit comments