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¶
Implements¶
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¶
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¶
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¶
Undo()¶
public void Undo()