Scripting API

Scripting API

ComponentTraits

Enum in Abyss.Core, from Abyss.Core.

What a component is, in the three respects a caller has to know before touching it.

public enum ComponentTraits : uint

Remarks

World.TraitsOf reports it. The bits are the engine's COMPONENT_IS_* constants and cross unchanged.

Values

NameValueDescription
None0None of the below — or the id names nothing.
Rust1The component has a Rust type: the engine's, Bevy's or a plugin's.
PlainData2A value of it can be made from bytes: zeroed at a spawn, carried by a command buffer, or written as a whole row through Chunk.GetSpan.
Engine4One of the components the engine declares itself.
Computed8Bevy or a plugin works it out for itself; it is not a person's to set.
CanBeAdded16It can be put on an entity with a starting value, through World.AddComponent.
Partial32Its layout and its enums leave part of it out — a list, a handle, a string, an enum that can hold an entity — so reading and writing its fields and choices reaches only the rest.
SerializesAllFields64A scene writes every field of it, even one a load would give the same value: its Rust type is marked #[reflect(SerializeAllFields)].
List128A list declared with AbyssListAttribute: each entity's holds as many items as it needs, read and written through World.ReadList and its kind, never as the component's bytes.