Scripting API

Scripting API

ComponentMove

Class in Abyss.Core, from Abyss.Core.

What moving a component's values onto another did; see World.MoveComponent.

public sealed class ComponentMove

Remarks

Where each value went is kept as well as what was lost, because a component's values are not the only thing that names them: an editor's undo history holds writes by component and offset, and ComponentMove.Find is what moves those across.

Properties

From

public ComponentId From { get; }

The component the values were on.

To

public ComponentId To { get; }

The component they are on now.

FromName

public string FromName { get; }

What ComponentMove.From was called.

ToName

public string ToName { get; }

What ComponentMove.To is called: ComponentMove.FromName for a component built again, and another name for one renamed, which says it was called that (FormerlySerializedAsAttribute).

Entities

public int Entities { get; }

How many entities carried it.

Dropped

public IReadOnlyList<string> Dropped { get; }

The fields the first had and the second has not, by name: what the move lost.

Converted

public IReadOnlyList<string> Converted { get; }

The fields both have, of another kind now, by name: what the move converted.

Renamed

public IReadOnlyList<(string Was, string Now)> Renamed { get; }

The fields the second has under another name, by what they were called and what they are now: what the move found by a FormerlySerializedAsAttribute.

Methods

Find

public (int Offset, FieldKind Kind)? Find(int offset)

Where the value at an offset in the first component went in the second, and what kind it is there.

Parameters

  • offset

Returns Null for an offset no value moved from: a field that was dropped, or no field's start.