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::EditParameterCommand Class Reference

Command to edit a node parameter. More...

#include <BTEditorCommand.h>

+ Inheritance diagram for Olympe::EditParameterCommand:
+ Collaboration diagram for Olympe::EditParameterCommand:

Public Types

enum class  ParamType { String , Int , Float }
 

Public Member Functions

 EditParameterCommand (BehaviorTreeAsset *tree, uint32_t nodeId, const std::string &paramName, const std::string &oldValue, const std::string &newValue, ParamType type)
 
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
 
uint32_t m_nodeId
 
std::string m_paramName
 
std::string m_oldValue
 
std::string m_newValue
 
ParamType m_paramType
 

Detailed Description

Command to edit a node parameter.

Definition at line 210 of file BTEditorCommand.h.

Member Enumeration Documentation

◆ ParamType

Enumerator
String 
Int 
Float 

Definition at line 213 of file BTEditorCommand.h.

Constructor & Destructor Documentation

◆ EditParameterCommand()

Olympe::EditParameterCommand::EditParameterCommand ( BehaviorTreeAsset tree,
uint32_t  nodeId,
const std::string &  paramName,
const std::string &  oldValue,
const std::string &  newValue,
ParamType  type 
)

Definition at line 329 of file BTEditorCommand.cpp.

Member Function Documentation

◆ Execute()

void Olympe::EditParameterCommand::Execute ( )
overridevirtual

Execute the command.

Implements Olympe::BTEditorCommand.

Definition at line 341 of file BTEditorCommand.cpp.

References Float, GetComponentTypeID_Static(), BehaviorTreeAsset::GetNode(), Int, m_newValue, m_nodeId, m_paramName, m_paramType, m_tree, String, and BTNode::stringParams.

+ Here is the call graph for this function:

◆ GetDescription()

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

Get a human-readable description of the command.

Implements Olympe::BTEditorCommand.

Definition at line 393 of file BTEditorCommand.cpp.

References m_paramName.

◆ Undo()

void Olympe::EditParameterCommand::Undo ( )
overridevirtual

Undo the command.

Implements Olympe::BTEditorCommand.

Definition at line 367 of file BTEditorCommand.cpp.

References Float, GetComponentTypeID_Static(), BehaviorTreeAsset::GetNode(), Int, m_nodeId, m_oldValue, m_paramName, m_paramType, m_tree, String, and BTNode::stringParams.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_newValue

std::string Olympe::EditParameterCommand::m_newValue
private

Definition at line 228 of file BTEditorCommand.h.

Referenced by Execute().

◆ m_nodeId

uint32_t Olympe::EditParameterCommand::m_nodeId
private

Definition at line 225 of file BTEditorCommand.h.

Referenced by Execute(), and Undo().

◆ m_oldValue

std::string Olympe::EditParameterCommand::m_oldValue
private

Definition at line 227 of file BTEditorCommand.h.

Referenced by Undo().

◆ m_paramName

std::string Olympe::EditParameterCommand::m_paramName
private

Definition at line 226 of file BTEditorCommand.h.

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

◆ m_paramType

ParamType Olympe::EditParameterCommand::m_paramType
private

Definition at line 229 of file BTEditorCommand.h.

Referenced by Execute(), and Undo().

◆ m_tree

BehaviorTreeAsset* Olympe::EditParameterCommand::m_tree
private

Definition at line 224 of file BTEditorCommand.h.

Referenced by Execute(), and Undo().


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