Skip to content

Class SetComponentCommand

Namespace: Apogee.Host.Editing
Assembly: Apogee.Host.dll

Changes the value of a component on an entity (an inspector field). The changes of one gesture merge: the command keeps the first "before" and the last "after".

public sealed class SetComponentCommand : IEditCommand

Inheritance

object ← SetComponentCommand

Implements

IEditCommand

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

SetComponentCommand(WorldRef, Entity, Entity, byte[], byte[], string)

Changes the value of a component on an entity (an inspector field). The changes of one gesture merge: the command keeps the first "before" and the last "after".

public SetComponentCommand(WorldRef worldRef, Entity entity, Entity component, byte[] before, byte[] after, string name)

Parameters

worldRef WorldRef

entity Entity

component Entity

before byte[]

after byte[]

name string

Properties

Name

What the Edit menu says: "Move Cube", "Delete Light".

public string Name { get; }

Property Value

string

Methods

Apply()

Does the edit (again, when redoing).

public void Apply()

Create(WorldRef, Entity, Entity, ReadOnlySpan<byte>, string)

The command for what is there now becoming after; null when nothing changed.

public static SetComponentCommand? Create(WorldRef worldRef, Entity entity, Entity component, ReadOnlySpan<byte> after, string name)

Parameters

worldRef WorldRef

entity Entity

component Entity

after ReadOnlySpan<byte>

name string

Returns

SetComponentCommand?

TryMerge(IEditCommand)

Lets the command before following take it in, so that a whole drag is one step: following has been done already; the command folds its result in (its "after") and returns true. Most commands return false.

public bool TryMerge(IEditCommand following)

Parameters

following IEditCommand

Returns

bool

Undo()

public void Undo()