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

Command to copy selected nodes to clipboard. More...

#include <BTGraphCommands.h>

+ Inheritance diagram for Olympe::CopyNodesCommand:
+ Collaboration diagram for Olympe::CopyNodesCommand:

Public Member Functions

 CopyNodesCommand (NodeGraph *graph, const std::vector< int > &nodeIds)
 
virtual ~CopyNodesCommand ()=default
 
bool Execute () override
 Execute the command (forward operation)
 
bool Undo () override
 Undo the command (reverse operation)
 
std::string GetDescription () const override
 Get a human-readable description of the command.
 
- Public Member Functions inherited from Olympe::GraphCommand
virtual ~GraphCommand ()=default
 
virtual bool CanMergeWith (const GraphCommand &other) const
 Check if this command can be merged with another Used for combining consecutive similar commands (e.g., multiple position changes)
 
virtual bool MergeWith (const GraphCommand &other)
 Merge this command with another Called only if CanMergeWith returned true.
 

Private Attributes

NodeGraphm_graph
 
std::vector< intm_nodeIds
 
std::vector< ClipboardNodem_clipboardData
 

Detailed Description

Command to copy selected nodes to clipboard.

Definition at line 27 of file BTGraphCommands.h.

Constructor & Destructor Documentation

◆ CopyNodesCommand()

Olympe::CopyNodesCommand::CopyNodesCommand ( NodeGraph graph,
const std::vector< int > &  nodeIds 
)

Definition at line 14 of file BTGraphCommands.cpp.

◆ ~CopyNodesCommand()

virtual Olympe::CopyNodesCommand::~CopyNodesCommand ( )
virtualdefault

Member Function Documentation

◆ Execute()

bool Olympe::CopyNodesCommand::Execute ( )
overridevirtual

Execute the command (forward operation)

Returns
true if execution succeeded

Implements Olympe::GraphCommand.

Definition at line 19 of file BTGraphCommands.cpp.

References Olympe::NodeGraph::CopyNodesToClipboard(), m_graph, and m_nodeIds.

+ Here is the call graph for this function:

◆ GetDescription()

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

Get a human-readable description of the command.

Returns
Command description for UI display (e.g., "Create Action Node")

Implements Olympe::GraphCommand.

Definition at line 34 of file BTGraphCommands.cpp.

References m_nodeIds.

◆ Undo()

bool Olympe::CopyNodesCommand::Undo ( )
overridevirtual

Undo the command (reverse operation)

Returns
true if undo succeeded

Implements Olympe::GraphCommand.

Definition at line 28 of file BTGraphCommands.cpp.

Member Data Documentation

◆ m_clipboardData

std::vector<ClipboardNode> Olympe::CopyNodesCommand::m_clipboardData
private

Definition at line 40 of file BTGraphCommands.h.

◆ m_graph

NodeGraph* Olympe::CopyNodesCommand::m_graph
private

Definition at line 38 of file BTGraphCommands.h.

Referenced by Execute().

◆ m_nodeIds

std::vector<int> Olympe::CopyNodesCommand::m_nodeIds
private

Definition at line 39 of file BTGraphCommands.h.

Referenced by Execute(), and GetDescription().


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