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

Command to add a node to the tree. More...

#include <BTEditorCommand.h>

+ Inheritance diagram for Olympe::AddNodeCommand:
+ Collaboration diagram for Olympe::AddNodeCommand:

Public Member Functions

 AddNodeCommand (BehaviorTreeAsset *tree, BTNodeType type, const std::string &name, const Vector &position)
 
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
 

Private Attributes

BehaviorTreeAssetm_tree
 
BTNodeType m_nodeType
 
std::string m_nodeName
 
Vector m_position
 
uint32_t m_createdNodeId
 

Detailed Description

Command to add a node to the tree.

Definition at line 105 of file BTEditorCommand.h.

Constructor & Destructor Documentation

◆ AddNodeCommand()

Olympe::AddNodeCommand::AddNodeCommand ( BehaviorTreeAsset tree,
BTNodeType  type,
const std::string &  name,
const Vector position 
)

Definition at line 97 of file BTEditorCommand.cpp.

Member Function Documentation

◆ Execute()

void Olympe::AddNodeCommand::Execute ( )
overridevirtual

Execute the command.

Implements Olympe::BTEditorCommand.

Definition at line 107 of file BTEditorCommand.cpp.

References BehaviorTreeAsset::AddNode(), m_createdNodeId, m_nodeName, m_nodeType, m_position, and m_tree.

+ Here is the call graph for this function:

◆ GetDescription()

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

Get a human-readable description of the command.

Implements Olympe::BTEditorCommand.

Definition at line 125 of file BTEditorCommand.cpp.

References m_nodeName.

◆ Undo()

void Olympe::AddNodeCommand::Undo ( )
overridevirtual

Undo the command.

Implements Olympe::BTEditorCommand.

Definition at line 116 of file BTEditorCommand.cpp.

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

+ Here is the call graph for this function:

Member Data Documentation

◆ m_createdNodeId

uint32_t Olympe::AddNodeCommand::m_createdNodeId
private

Definition at line 119 of file BTEditorCommand.h.

Referenced by Execute(), and Undo().

◆ m_nodeName

std::string Olympe::AddNodeCommand::m_nodeName
private

Definition at line 117 of file BTEditorCommand.h.

Referenced by Execute(), and GetDescription().

◆ m_nodeType

BTNodeType Olympe::AddNodeCommand::m_nodeType
private

Definition at line 116 of file BTEditorCommand.h.

Referenced by Execute().

◆ m_position

Vector Olympe::AddNodeCommand::m_position
private

Definition at line 118 of file BTEditorCommand.h.

Referenced by Execute().

◆ m_tree

BehaviorTreeAsset* Olympe::AddNodeCommand::m_tree
private

Definition at line 115 of file BTEditorCommand.h.

Referenced by Execute(), and Undo().


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