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

Manages undo/redo stacks for editor commands. More...

#include <BTEditorCommand.h>

Public Member Functions

void Execute (std::unique_ptr< BTEditorCommand > cmd)
 Execute a command and add it to the undo stack.
 
void Undo ()
 Undo the last command.
 
void Redo ()
 Redo the last undone command.
 
bool CanUndo () const
 Check if undo is available.
 
bool CanRedo () const
 Check if redo is available.
 
std::string GetUndoDescription () const
 Get description of the next undo command.
 
std::string GetRedoDescription () const
 Get description of the next redo command.
 
void Clear ()
 Clear all commands.
 

Private Attributes

std::vector< std::unique_ptr< BTEditorCommand > > m_undoStack
 
std::vector< std::unique_ptr< BTEditorCommand > > m_redoStack
 

Static Private Attributes

static const size_t kMaxStackSize = 100
 

Detailed Description

Manages undo/redo stacks for editor commands.

Definition at line 51 of file BTEditorCommand.h.

Member Function Documentation

◆ CanRedo()

bool Olympe::BTCommandStack::CanRedo ( ) const

Check if redo is available.

Definition at line 66 of file BTEditorCommand.cpp.

References m_redoStack.

Referenced by GetRedoDescription(), Redo(), and Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow().

+ Here is the caller graph for this function:

◆ CanUndo()

bool Olympe::BTCommandStack::CanUndo ( ) const

Check if undo is available.

Definition at line 61 of file BTEditorCommand.cpp.

References m_undoStack.

Referenced by GetUndoDescription(), Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow(), and Undo().

+ Here is the caller graph for this function:

◆ Clear()

void Olympe::BTCommandStack::Clear ( )

Clear all commands.

Definition at line 87 of file BTEditorCommand.cpp.

References m_redoStack, and m_undoStack.

◆ Execute()

void Olympe::BTCommandStack::Execute ( std::unique_ptr< BTEditorCommand cmd)

Execute a command and add it to the undo stack.

Parameters
cmdCommand to execute

Definition at line 16 of file BTEditorCommand.cpp.

References GetComponentTypeID_Static(), kMaxStackSize, m_redoStack, and m_undoStack.

+ Here is the call graph for this function:

◆ GetRedoDescription()

std::string Olympe::BTCommandStack::GetRedoDescription ( ) const

Get description of the next redo command.

Definition at line 79 of file BTEditorCommand.cpp.

References CanRedo(), and m_redoStack.

+ Here is the call graph for this function:

◆ GetUndoDescription()

std::string Olympe::BTCommandStack::GetUndoDescription ( ) const

Get description of the next undo command.

Definition at line 71 of file BTEditorCommand.cpp.

References CanUndo(), and m_undoStack.

+ Here is the call graph for this function:

◆ Redo()

void Olympe::BTCommandStack::Redo ( )

Redo the last undone command.

Definition at line 48 of file BTEditorCommand.cpp.

References CanRedo(), GetComponentTypeID_Static(), m_redoStack, and m_undoStack.

Referenced by Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Undo()

void Olympe::BTCommandStack::Undo ( )

Undo the last command.

Definition at line 35 of file BTEditorCommand.cpp.

References CanUndo(), GetComponentTypeID_Static(), m_redoStack, and m_undoStack.

Referenced by Olympe::BehaviorTreeDebugWindow::RenderInSeparateWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ kMaxStackSize

const size_t Olympe::BTCommandStack::kMaxStackSize = 100
staticprivate

Definition at line 98 of file BTEditorCommand.h.

Referenced by Execute().

◆ m_redoStack

std::vector<std::unique_ptr<BTEditorCommand> > Olympe::BTCommandStack::m_redoStack
private

Definition at line 97 of file BTEditorCommand.h.

Referenced by CanRedo(), Clear(), Execute(), GetRedoDescription(), Redo(), and Undo().

◆ m_undoStack

std::vector<std::unique_ptr<BTEditorCommand> > Olympe::BTCommandStack::m_undoStack
private

Definition at line 96 of file BTEditorCommand.h.

Referenced by CanUndo(), Clear(), Execute(), GetUndoDescription(), Redo(), and Undo().


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