Scripting API

Scripting API

ComponentBatch

Struct in Abyss.Core, from Abyss.Core.

A pending change to entities that already exist, whose new component values are written through spans.

public readonly ref struct ComponentBatch

Remarks

The same shape as SpawnBatch — a ref struct for the same reason, and the values are laid out identically. What differs is only that the entities were named by the caller instead of created for it, so the ids here are not a result to read back.

Properties

Count

public int Count { get; }

Number of entities this batch changes.

Methods

GetSpan<T>

public Span<T> GetSpan<T>(int component) where T : unmanaged

The values one component will take, by the index it holds in the archetype.

Type parameters

  • T

Parameters

  • component

Starts zeroed, so a component left untouched is given its zero value rather than whatever the buffer last contained — and rather than the value the entity already had, which is gone either way because an add overwrites.