Class RenameCommand¶
Namespace: Apogee.Host.Editing
Assembly: Apogee.Host.dll
Renames an entity. Names have to be unique among siblings, so the caller checks
public sealed class RenameCommand : IEditCommand
Inheritance¶
Implements¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors¶
RenameCommand(WorldRef, Entity, string)¶
Renames an entity. Names have to be unique among siblings, so the caller checks
public RenameCommand(WorldRef worldRef, Entity entity, string newName)
Parameters¶
worldRef WorldRef
entity Entity
newName 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()
IsFree(World, Entity, string)¶
Whether no other child of entity's parent (or no other root) has this name.
public static bool IsFree(World world, Entity entity, string name)
Parameters¶
world World
entity Entity
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()