Skip to content

Class CreateEntityCommand

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

Makes an entity (with create: a new one, a clone, a model dropped into the viewport) and removes it again on undo. Redoing brings it back under the id it had.

public sealed class CreateEntityCommand : IEditCommand

Inheritance

object ← CreateEntityCommand

Implements

IEditCommand

Inherited Members

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

Constructors

CreateEntityCommand(WorldRef, string, Func<Entity>)

Makes an entity (with create: a new one, a clone, a model dropped into the viewport) and removes it again on undo. Redoing brings it back under the id it had.

public CreateEntityCommand(WorldRef worldRef, string name, Func<Entity> create)

Parameters

worldRef WorldRef

name string

create Func<Entity>

Properties

Entity

The entity this made (set by the first ).

public Entity Entity { get; }

Property Value

Entity

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()

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()