Scripting API
Scripting API
EntityRow
Struct in Abyss.Core, from Abyss.Core.
One entity, as a list of them crosses from the engine.
public struct EntityRowRemarks
The index is carried rather than unpacked from EntityRow.Id, because Bevy does not promise a structure for the bits an entity id is made of. It happens to be index-then-generation today, and an editor labeling its rows by taking the low half would be relying on an accident that costs nothing to avoid.
EntityRow.Id is what every other call takes; EntityRow.Index is what a person recognizes an entity by.
EntityRow.Parent and EntityRow.Flags are here rather than in calls of their own for the reason every bulk shape in this engine exists: a panel showing a tree needs the parent of every row, and asking one entity at a time would put a crossing on each of them, every capture.
EntityRow.Archetype is the same argument about what an entity carries, and it was free: the row was twenty-eight bytes of fields padded to thirty-two, and the archetype is the four that used to be padding.
Fields
Id
public ulong IdThe opaque id, which is what every call that takes an entity wants.
Parent
public ulong ParentThe opaque id of this entity's parent, or zero when it has none.
Zero is not a valid entity — a generation of zero never occurs — so it means "no parent" without needing a flag of its own.
Scene
public SceneId SceneThe scene this entity is in, or SceneId.None when it is in none.
Here for the reason EntityRow.Parent is: a panel that lists entities under their scenes needs the scene of every row.
Index
public uint IndexThe index: short, stable while the entity lives, and worth showing a person.
Generation
public uint GenerationHow many times this index has been reused.
Flags
public EntityKind FlagsWhat sort of entity this is.
Archetype
public uint ArchetypeWhich set of components this entity carries, as the engine groups them.
A number, and one that can be asked about once. Every entity carrying the same components has the same number, World.ArchetypeComponents says what they are, and the answer never changes while the world lives — an entity that gains a component moves to a different number rather than changing the one it had. So a panel that wants to know what four thousand rows carry asks a few dozen times and remembers.
It means nothing in another world, or in this one after it is disposed, and it is never written into a file.
Order
public uint OrderWhere it comes among its siblings, from zero: its place in its parent's children, or among the entities with no parent; uint.MaxValue for the engine's own with none, which have no order. See World.Place.
