![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Command to delete a node from the tree. 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 (int32_t nodeID) | |
| 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 |
| Get a human-readable description of the command. | |
Public Member Functions inherited from Olympe::BTEditorCommand | |
| virtual | ~BTEditorCommand ()=default |
| virtual | ~BTEditorCommand ()=default |
Public Member Functions inherited from Olympe::ICommand | |
| virtual | ~ICommand ()=default |
Private Attributes | |
| BehaviorTreeAsset * | m_tree |
| uint32_t | m_nodeId |
| BTNode | m_savedNode |
| std::vector< Connection > | m_savedConnections |
| int32_t | m_nodeID |
| TaskNodeDefinition | m_savedNode |
| std::vector< ExecPinConnection > | m_savedExecConns |
| std::vector< DataPinConnection > | m_savedDataConns |
Command to delete a node from the tree.
Records a "delete node" operation for undo/redo.
On Execute() the node is removed from the graph (and any exec/data connections referencing it are also removed). On Undo() the node and its connections are restored.
Definition at line 131 of file BTEditorCommand.h.
| Olympe::DeleteNodeCommand::DeleteNodeCommand | ( | BehaviorTreeAsset * | tree, |
| uint32_t | nodeId | ||
| ) |
Definition at line 139 of file BTEditorCommand.cpp.
References GetComponentTypeID_Static(), m_savedConnections, m_savedNode, and Olympe::DeleteNodeCommand::Connection::parentId.
Here is the call graph for this function:
|
explicit |
Definition at line 51 of file UndoRedoStack.cpp.
|
overridevirtual |
Execute the command.
Implements Olympe::BTEditorCommand.
Definition at line 182 of file BTEditorCommand.cpp.
References m_nodeId, m_tree, and BehaviorTreeAsset::RemoveNode().
Here is the call graph for this function:
|
overridevirtual |
Applies the command to the graph.
Implements Olympe::ICommand.
Definition at line 56 of file UndoRedoStack.cpp.
References GetComponentTypeID_Static(), m_nodeID, m_savedDataConns, m_savedExecConns, and m_savedNode.
Here is the call graph for this function:
|
overridevirtual |
Get a human-readable description of the command.
Implements Olympe::BTEditorCommand.
Definition at line 227 of file BTEditorCommand.cpp.
References m_nodeId.
|
overridevirtual |
Get a human-readable description of the command.
Implements Olympe::BTEditorCommand.
|
overridevirtual |
Undo the command.
Implements Olympe::BTEditorCommand.
Definition at line 191 of file BTEditorCommand.cpp.
References BTNode::childIds, BTNode::decoratorChildId, GetComponentTypeID_Static(), BehaviorTreeAsset::GetNode(), m_nodeId, m_savedConnections, m_savedNode, m_tree, and BehaviorTreeAsset::nodes.
Here is the call graph for this function:
|
overridevirtual |
Reverses the command on the graph.
Implements Olympe::ICommand.
Definition at line 104 of file UndoRedoStack.cpp.
References GetComponentTypeID_Static(), m_savedDataConns, m_savedExecConns, and m_savedNode.
Here is the call graph for this function:
|
private |
Definition at line 142 of file BTEditorCommand.h.
Referenced by Execute(), GetDescription(), and Undo().
|
private |
Definition at line 92 of file UndoRedoStack.h.
Referenced by Execute().
|
private |
Definition at line 150 of file BTEditorCommand.h.
Referenced by DeleteNodeCommand(), and Undo().
|
private |
Definition at line 95 of file UndoRedoStack.h.
|
private |
Definition at line 94 of file UndoRedoStack.h.
|
private |
Definition at line 143 of file BTEditorCommand.h.
Referenced by DeleteNodeCommand(), Execute(), Undo(), and Undo().
|
private |
Definition at line 93 of file UndoRedoStack.h.
|
private |
Definition at line 141 of file BTEditorCommand.h.