Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
Olympe::EditNodePropertiesCommand Class Reference

Records a batch edit of all parameter bindings on a node. More...

#include <UndoRedoStack.h>

+ Inheritance diagram for Olympe::EditNodePropertiesCommand:
+ Collaboration diagram for Olympe::EditNodePropertiesCommand:

Public Types

using ParameterMap = std::unordered_map< std::string, ParameterBinding >
 

Public Member Functions

 EditNodePropertiesCommand (int32_t nodeID, const ParameterMap &oldParams, const ParameterMap &newParams)
 
void Execute (TaskGraphTemplate &graph) override
 Applies the command to the graph.
 
void Undo (TaskGraphTemplate &graph) override
 Reverses the command on the graph.
 
std::string GetDescription () const override
 Returns a short human-readable description (e.g.
 
- Public Member Functions inherited from Olympe::ICommand
virtual ~ICommand ()=default
 

Private Attributes

int32_t m_nodeID
 
ParameterMap m_oldParams
 
ParameterMap m_newParams
 

Detailed Description

Records a batch edit of all parameter bindings on a node.

Suitable for snapshotting the full parameter map before a complex edit and restoring it atomically on Undo().

Definition at line 357 of file UndoRedoStack.h.

Member Typedef Documentation

◆ ParameterMap

Definition at line 359 of file UndoRedoStack.h.

Constructor & Destructor Documentation

◆ EditNodePropertiesCommand()

Olympe::EditNodePropertiesCommand::EditNodePropertiesCommand ( int32_t  nodeID,
const ParameterMap oldParams,
const ParameterMap newParams 
)

Definition at line 646 of file UndoRedoStack.cpp.

Member Function Documentation

◆ Execute()

void Olympe::EditNodePropertiesCommand::Execute ( TaskGraphTemplate graph)
overridevirtual

Applies the command to the graph.

Implements Olympe::ICommand.

Definition at line 654 of file UndoRedoStack.cpp.

References GetComponentTypeID_Static(), m_newParams, and m_nodeID.

+ Here is the call graph for this function:

◆ GetDescription()

std::string Olympe::EditNodePropertiesCommand::GetDescription ( ) const
overridevirtual

Returns a short human-readable description (e.g.

"Add Node #3").

Implements Olympe::ICommand.

Definition at line 678 of file UndoRedoStack.cpp.

References m_nodeID.

◆ Undo()

void Olympe::EditNodePropertiesCommand::Undo ( TaskGraphTemplate graph)
overridevirtual

Reverses the command on the graph.

Implements Olympe::ICommand.

Definition at line 666 of file UndoRedoStack.cpp.

References GetComponentTypeID_Static(), m_nodeID, and m_oldParams.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_newParams

ParameterMap Olympe::EditNodePropertiesCommand::m_newParams
private

Definition at line 372 of file UndoRedoStack.h.

Referenced by Execute().

◆ m_nodeID

int32_t Olympe::EditNodePropertiesCommand::m_nodeID
private

Definition at line 370 of file UndoRedoStack.h.

Referenced by Execute(), GetDescription(), and Undo().

◆ m_oldParams

ParameterMap Olympe::EditNodePropertiesCommand::m_oldParams
private

Definition at line 371 of file UndoRedoStack.h.

Referenced by Undo().


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