![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
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 ¶mName, 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. | |
| EditParameterCommand (int32_t nodeID, const std::string ¶mName, const ParameterBinding &oldBinding, const ParameterBinding &newBinding) | |
| 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 |
| std::string | m_paramName |
| std::string | m_oldValue |
| std::string | m_newValue |
| ParamType | m_paramType |
| int32_t | m_nodeID |
| ParameterBinding | m_oldBinding |
| ParameterBinding | m_newBinding |
Command to edit a node parameter.
Records an edit to a single named parameter binding on a node.
Stores the old and new ParameterBinding (type + literal value + variable name) so that the change can be reversed via Undo() and re-applied via Execute().
Definition at line 215 of file BTEditorCommand.h.
| Enumerator | |
|---|---|
| String | |
| Int | |
| Float | |
Definition at line 218 of file BTEditorCommand.h.
| 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 334 of file BTEditorCommand.cpp.
| Olympe::EditParameterCommand::EditParameterCommand | ( | int32_t | nodeID, |
| const std::string & | paramName, | ||
| const ParameterBinding & | oldBinding, | ||
| const ParameterBinding & | newBinding | ||
| ) |
Definition at line 603 of file UndoRedoStack.cpp.
|
overridevirtual |
Execute the command.
Implements Olympe::BTEditorCommand.
Definition at line 346 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:
|
overridevirtual |
Applies the command to the graph.
Implements Olympe::ICommand.
Definition at line 613 of file UndoRedoStack.cpp.
References GetComponentTypeID_Static(), m_newBinding, m_nodeID, and m_paramName.
Here is the call graph for this function:
|
overridevirtual |
Get a human-readable description of the command.
Implements Olympe::BTEditorCommand.
Definition at line 398 of file BTEditorCommand.cpp.
References m_paramName.
|
overridevirtual |
Get a human-readable description of the command.
Implements Olympe::BTEditorCommand.
|
overridevirtual |
Undo the command.
Implements Olympe::BTEditorCommand.
Definition at line 372 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:
|
overridevirtual |
Reverses the command on the graph.
Implements Olympe::ICommand.
Definition at line 625 of file UndoRedoStack.cpp.
References GetComponentTypeID_Static(), m_nodeID, m_oldBinding, and m_paramName.
Here is the call graph for this function:
|
private |
Definition at line 343 of file UndoRedoStack.h.
Referenced by Execute().
|
private |
Definition at line 233 of file BTEditorCommand.h.
Referenced by Execute().
|
private |
Definition at line 230 of file BTEditorCommand.h.
|
private |
Definition at line 340 of file UndoRedoStack.h.
|
private |
Definition at line 342 of file UndoRedoStack.h.
Referenced by Undo().
|
private |
Definition at line 232 of file BTEditorCommand.h.
Referenced by Undo().
|
private |
Definition at line 231 of file BTEditorCommand.h.
Referenced by Execute(), Execute(), GetDescription(), Undo(), and Undo().
|
private |
Definition at line 234 of file BTEditorCommand.h.
|
private |
Definition at line 229 of file BTEditorCommand.h.