Struct LocalVisibilityView
Namespace: OblivionMp.Sdk.Archetypes.Mixins
Assembly: OblivionMp.Sdk.dll
Walks this shape by chunk. Valid only inside the loop that produced it.
public readonly ref struct LocalVisibilityView : IArchetypeChunkView<LocalVisibilityView>, IEntityShape
Implements
IArchetypeChunkView<LocalVisibilityView>, IEntityShape
Inherited Members
object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Properties
Components
The components a query has to ask for, in the order the slots arrive in.
static ComponentSet Components { get; }
Property Value
ComponentSet
Handle
The way out to anything a chunk view cannot do, such as a structural change after the loop.
public EntityHandle Handle { get; }
Property Value
EntityHandle
Hidden
How hard the character is to see here: 0 in plain sight, 1 invisible.
public float Hidden { get; set; }
Property Value
SlotCount
How many slots this view consumes, so several can share one chunk's worth.
static int SlotCount { get; }
Property Value
Remarks
One slot per component, which the set already knows, so a view that does not say is not wrong. The generator states it anyway, as a constant rather than a field read.
Methods
At(int)
The same binding, moved to another entity of the same chunk.
public LocalVisibilityView At(int index)
Parameters
index int
Returns
Bind(ReadOnlySpan<ChunkSlot>, ReadOnlySpan<RawEntity>, EntityHandle)
Binds the view to one chunk, positioned at its first entity.
static LocalVisibilityView Bind(ReadOnlySpan<ChunkSlot> slots, ReadOnlySpan<RawEntity> entities, EntityHandle prototype)
Parameters
slots ReadOnlySpan<ChunkSlot>
entities ReadOnlySpan<RawEntity>
prototype EntityHandle
Returns
Keep()
This entity as the shape, which is what a view cannot be: one outlives the loop, the other does not.
public LocalVisibility Keep()
Returns
Remarks
For collecting entities to act on afterwards. The shape reads through a handle rather than the chunk, so it costs a lookup per value; inside the loop the view is the cheaper way to read.