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

DeleteNodeCommand - Command to delete a node from graph. More...

#include <BTEditorCommand.h>

+ Inheritance diagram for Olympe::DeleteNodeCommand:
+ Collaboration diagram for Olympe::DeleteNodeCommand:

Classes

struct  Connection
 

Public Member Functions

 DeleteNodeCommand (BehaviorTreeAsset *tree, uint32_t nodeId)
 
void Execute () override
 Execute the command.
 
void Undo () override
 Undo the command.
 
std::string GetDescription () const override
 Get a human-readable description of the command.
 
 DeleteNodeCommand (const std::string &graphId, int nodeId)
 
void Execute () override
 Execute the command.
 
void Undo () override
 Undo the command.
 
std::string GetDescription () const override
 Get a human-readable description of the command.
 
- Public Member Functions inherited from Olympe::BTEditorCommand
virtual ~BTEditorCommand ()=default
 
- Public Member Functions inherited from Olympe::EditorCommand
virtual ~EditorCommand ()=default
 

Private Attributes

BehaviorTreeAssetm_tree
 
uint32_t m_nodeId
 
BTNode m_savedNode
 
std::vector< Connectionm_savedConnections
 
std::string m_GraphId
 
int m_NodeId
 
json m_NodeData
 

Detailed Description

DeleteNodeCommand - Command to delete a node from graph.

Command to delete a node from the tree.

Definition at line 126 of file BTEditorCommand.h.

Constructor & Destructor Documentation

◆ DeleteNodeCommand() [1/2]

Olympe::DeleteNodeCommand::DeleteNodeCommand ( BehaviorTreeAsset tree,
uint32_t  nodeId 
)

Definition at line 134 of file BTEditorCommand.cpp.

References GetComponentTypeID_Static(), m_savedConnections, m_savedNode, and Olympe::DeleteNodeCommand::Connection::parentId.

+ Here is the call graph for this function:

◆ DeleteNodeCommand() [2/2]

Olympe::DeleteNodeCommand::DeleteNodeCommand ( const std::string &  graphId,
int  nodeId 
)

Definition at line 201 of file CommandSystem.cpp.

Member Function Documentation

◆ Execute() [1/2]

void Olympe::DeleteNodeCommand::Execute ( )
overridevirtual

Execute the command.

Implements Olympe::BTEditorCommand.

Definition at line 177 of file BTEditorCommand.cpp.

References m_nodeId, m_tree, and BehaviorTreeAsset::RemoveNode().

+ Here is the call graph for this function:

◆ Execute() [2/2]

void Olympe::DeleteNodeCommand::Execute ( )
overridevirtual

Execute the command.

Implements Olympe::BTEditorCommand.

◆ GetDescription() [1/2]

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

Get a human-readable description of the command.

Implements Olympe::BTEditorCommand.

Definition at line 222 of file BTEditorCommand.cpp.

References m_nodeId.

◆ GetDescription() [2/2]

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

Get a human-readable description of the command.

Implements Olympe::BTEditorCommand.

◆ Undo() [1/2]

void Olympe::DeleteNodeCommand::Undo ( )
overridevirtual

◆ Undo() [2/2]

void Olympe::DeleteNodeCommand::Undo ( )
overridevirtual

Undo the command.

Implements Olympe::BTEditorCommand.

Member Data Documentation

◆ m_GraphId

std::string Olympe::DeleteNodeCommand::m_GraphId
private

Definition at line 125 of file CommandSystem.h.

◆ m_NodeData

json Olympe::DeleteNodeCommand::m_NodeData
private

Definition at line 127 of file CommandSystem.h.

◆ m_nodeId

uint32_t Olympe::DeleteNodeCommand::m_nodeId
private

Definition at line 137 of file BTEditorCommand.h.

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

◆ m_NodeId

int Olympe::DeleteNodeCommand::m_NodeId
private

Definition at line 126 of file CommandSystem.h.

◆ m_savedConnections

std::vector<Connection> Olympe::DeleteNodeCommand::m_savedConnections
private

Definition at line 145 of file BTEditorCommand.h.

Referenced by DeleteNodeCommand(), and Undo().

◆ m_savedNode

BTNode Olympe::DeleteNodeCommand::m_savedNode
private

Definition at line 138 of file BTEditorCommand.h.

Referenced by DeleteNodeCommand(), and Undo().

◆ m_tree

BehaviorTreeAsset* Olympe::DeleteNodeCommand::m_tree
private

Definition at line 136 of file BTEditorCommand.h.

Referenced by Execute(), and Undo().


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