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

MoveNodeCommand - Command to move a node's position. More...

#include <BTEditorCommand.h>

+ Inheritance diagram for Olympe::MoveNodeCommand:
+ Collaboration diagram for Olympe::MoveNodeCommand:

Public Member Functions

 MoveNodeCommand (BehaviorTreeAsset *tree, uint32_t nodeId, const Vector &oldPos, const Vector &newPos)
 
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.
 
 MoveNodeCommand (const std::string &graphId, int nodeId, float oldX, float oldY, float newX, float newY)
 
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
 
Vector m_oldPosition
 
Vector m_newPosition
 
std::string m_GraphId
 
int m_NodeId
 
float m_OldX
 
float m_OldY
 
float m_NewX
 
float m_NewY
 

Detailed Description

MoveNodeCommand - Command to move a node's position.

Command to move a node.

Definition at line 152 of file BTEditorCommand.h.

Constructor & Destructor Documentation

◆ MoveNodeCommand() [1/2]

Olympe::MoveNodeCommand::MoveNodeCommand ( BehaviorTreeAsset tree,
uint32_t  nodeId,
const Vector oldPos,
const Vector newPos 
)

Definition at line 231 of file BTEditorCommand.cpp.

◆ MoveNodeCommand() [2/2]

Olympe::MoveNodeCommand::MoveNodeCommand ( const std::string &  graphId,
int  nodeId,
float  oldX,
float  oldY,
float  newX,
float  newY 
)

Definition at line 268 of file CommandSystem.cpp.

Member Function Documentation

◆ Execute() [1/2]

void Olympe::MoveNodeCommand::Execute ( )
overridevirtual

Execute the command.

Implements Olympe::BTEditorCommand.

Definition at line 240 of file BTEditorCommand.cpp.

References m_nodeId.

◆ Execute() [2/2]

void Olympe::MoveNodeCommand::Execute ( )
overridevirtual

Execute the command.

Implements Olympe::BTEditorCommand.

◆ GetDescription() [1/2]

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

Get a human-readable description of the command.

Implements Olympe::BTEditorCommand.

Definition at line 252 of file BTEditorCommand.cpp.

References m_nodeId.

◆ GetDescription() [2/2]

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

Get a human-readable description of the command.

Implements Olympe::BTEditorCommand.

◆ Undo() [1/2]

void Olympe::MoveNodeCommand::Undo ( )
overridevirtual

Undo the command.

Implements Olympe::BTEditorCommand.

Definition at line 247 of file BTEditorCommand.cpp.

References m_nodeId.

◆ Undo() [2/2]

void Olympe::MoveNodeCommand::Undo ( )
overridevirtual

Undo the command.

Implements Olympe::BTEditorCommand.

Member Data Documentation

◆ m_GraphId

std::string Olympe::MoveNodeCommand::m_GraphId
private

Definition at line 144 of file CommandSystem.h.

◆ m_newPosition

Vector Olympe::MoveNodeCommand::m_newPosition
private

Definition at line 165 of file BTEditorCommand.h.

◆ m_NewX

float Olympe::MoveNodeCommand::m_NewX
private

Definition at line 147 of file CommandSystem.h.

◆ m_NewY

float Olympe::MoveNodeCommand::m_NewY
private

Definition at line 147 of file CommandSystem.h.

◆ m_nodeId

uint32_t Olympe::MoveNodeCommand::m_nodeId
private

Definition at line 163 of file BTEditorCommand.h.

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

◆ m_NodeId

int Olympe::MoveNodeCommand::m_NodeId
private

Definition at line 145 of file CommandSystem.h.

◆ m_oldPosition

Vector Olympe::MoveNodeCommand::m_oldPosition
private

Definition at line 164 of file BTEditorCommand.h.

◆ m_OldX

float Olympe::MoveNodeCommand::m_OldX
private

Definition at line 146 of file CommandSystem.h.

◆ m_OldY

float Olympe::MoveNodeCommand::m_OldY
private

Definition at line 146 of file CommandSystem.h.

◆ m_tree

BehaviorTreeAsset* Olympe::MoveNodeCommand::m_tree
private

Definition at line 162 of file BTEditorCommand.h.


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