Cogs.Core
Public Member Functions | Private Attributes | List of all members
Cogs::Core::DestroyCommand Struct Reference
Inheritance diagram for Cogs::Core::DestroyCommand:
Cogs::Core::EditorCommand

Public Member Functions

 DestroyCommand (EditorState *state, const EntityIds &entityIds, bool allowUndo)
 
void apply () override
 Run the command.
 
void undo () override
 
- Public Member Functions inherited from Cogs::Core::EditorCommand
 EditorCommand (EditorState *state, Context *context)
 
virtual void apply ()=0
 Run the command.
 
virtual void undo ()=0
 
virtual void redo ()
 
virtual bool mergeWith (const EditorCommand *)
 
virtual MeshHandle applyMesh (MeshHandle)
 Workaround for having extendable mesh processing available without linking (e.g command -> RR).
 
virtual void close ()
 Close command, i.e. prevent merging with another command.
 
bool isClosed () const
 
bool merge (const EditorCommand *command)
 Merge into this if not this is closed.
 

Private Attributes

bool allowUndo
 
EntityIds entityIds
 
EntityIds parentIds
 
rapidjson::Document copied
 

Additional Inherited Members

- Public Attributes inherited from Cogs::Core::EditorCommand
std::vector< ParsedValueoptions
 Options passed to the command when running in batch mode.
 
bool permanentUndo = false
 True if cannot Redo after Undo.
 
- Protected Attributes inherited from Cogs::Core::EditorCommand
EditorStatestate = nullptr
 
Contextcontext = nullptr
 

Detailed Description

Definition at line 96 of file EditorCommand.h.

Constructor & Destructor Documentation

◆ DestroyCommand()

Cogs::Core::DestroyCommand::DestroyCommand ( EditorState state,
const EntityIds &  entityIds,
bool  allowUndo 
)
inline

Definition at line 98 of file EditorCommand.h.

Member Function Documentation

◆ apply()

void Cogs::Core::DestroyCommand::apply ( )
overridevirtual

Run the command.

In batch scripts this method is called for all type of commands. In interactive mode this method is not called for model commands (subclasses of ModalEditorCommand)

Implements Cogs::Core::EditorCommand.

Definition at line 365 of file EditorCommand.cpp.

References Cogs::Core::Geometry, Cogs::ComponentModel::Entity::getId(), Cogs::Core::Hierarchy, and Cogs::Core::writeEntity().

◆ undo()

void Cogs::Core::DestroyCommand::undo ( )
overridevirtual

Implements Cogs::Core::EditorCommand.

Definition at line 408 of file EditorCommand.cpp.

Member Data Documentation

◆ allowUndo

bool Cogs::Core::DestroyCommand::allowUndo
private

Definition at line 107 of file EditorCommand.h.

◆ copied

rapidjson::Document Cogs::Core::DestroyCommand::copied
private

Definition at line 110 of file EditorCommand.h.

◆ entityIds

EntityIds Cogs::Core::DestroyCommand::entityIds
private

Definition at line 108 of file EditorCommand.h.

◆ parentIds

EntityIds Cogs::Core::DestroyCommand::parentIds
private

Definition at line 109 of file EditorCommand.h.


The documentation for this struct was generated from the following files: