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

#include <EditorState.h>

Public Member Functions

 EditorState ()
 
 ~EditorState ()
 
void ExecuteCommand (std::unique_ptr< Command > command, LevelManager &levelManager)
 
bool Undo (LevelManager &levelManager)
 
bool Redo (LevelManager &levelManager)
 
bool CanUndo () const
 
bool CanRedo () const
 
std::string GetUndoDescription () const
 
std::string GetRedoDescription () const
 
void ClearHistory ()
 
size_t GetHistorySize () const
 
size_t GetHistoryIndex () const
 
void SetMaxHistorySize (size_t maxSize)
 

Private Member Functions

void TrimHistory ()
 

Private Attributes

std::deque< std::unique_ptr< Command > > m_commandHistory
 
size_t m_historyIndex
 
size_t m_maxHistorySize
 

Detailed Description

Definition at line 134 of file EditorState.h.

Constructor & Destructor Documentation

◆ EditorState()

Olympe::Editor::EditorState::EditorState ( )

Definition at line 187 of file EditorState.cpp.

◆ ~EditorState()

Olympe::Editor::EditorState::~EditorState ( )

Definition at line 192 of file EditorState.cpp.

Member Function Documentation

◆ CanRedo()

bool Olympe::Editor::EditorState::CanRedo ( ) const

Definition at line 259 of file EditorState.cpp.

References m_commandHistory, and m_historyIndex.

Referenced by GetRedoDescription(), and Redo().

+ Here is the caller graph for this function:

◆ CanUndo()

bool Olympe::Editor::EditorState::CanUndo ( ) const

Definition at line 254 of file EditorState.cpp.

References m_historyIndex.

Referenced by GetUndoDescription(), and Undo().

+ Here is the caller graph for this function:

◆ ClearHistory()

void Olympe::Editor::EditorState::ClearHistory ( )

Definition at line 282 of file EditorState.cpp.

References m_commandHistory, and m_historyIndex.

◆ ExecuteCommand()

void Olympe::Editor::EditorState::ExecuteCommand ( std::unique_ptr< Command command,
LevelManager levelManager 
)

Definition at line 196 of file EditorState.cpp.

References GetComponentTypeID_Static(), m_commandHistory, m_historyIndex, and TrimHistory().

+ Here is the call graph for this function:

◆ GetHistoryIndex()

size_t Olympe::Editor::EditorState::GetHistoryIndex ( ) const
inline

Definition at line 162 of file EditorState.h.

References m_historyIndex.

◆ GetHistorySize()

size_t Olympe::Editor::EditorState::GetHistorySize ( ) const
inline

Definition at line 161 of file EditorState.h.

References m_commandHistory.

◆ GetRedoDescription()

std::string Olympe::Editor::EditorState::GetRedoDescription ( ) const

Definition at line 273 of file EditorState.cpp.

References CanRedo(), m_commandHistory, and m_historyIndex.

+ Here is the call graph for this function:

◆ GetUndoDescription()

std::string Olympe::Editor::EditorState::GetUndoDescription ( ) const

Definition at line 264 of file EditorState.cpp.

References CanUndo(), m_commandHistory, and m_historyIndex.

+ Here is the call graph for this function:

◆ Redo()

bool Olympe::Editor::EditorState::Redo ( LevelManager levelManager)

Definition at line 240 of file EditorState.cpp.

References CanRedo(), GetComponentTypeID_Static(), m_commandHistory, and m_historyIndex.

+ Here is the call graph for this function:

◆ SetMaxHistorySize()

void Olympe::Editor::EditorState::SetMaxHistorySize ( size_t  maxSize)
inline

Definition at line 165 of file EditorState.h.

References GetComponentTypeID_Static(), and m_maxHistorySize.

+ Here is the call graph for this function:

◆ TrimHistory()

void Olympe::Editor::EditorState::TrimHistory ( )
private

Definition at line 289 of file EditorState.cpp.

References m_commandHistory, m_historyIndex, and m_maxHistorySize.

Referenced by ExecuteCommand().

+ Here is the caller graph for this function:

◆ Undo()

bool Olympe::Editor::EditorState::Undo ( LevelManager levelManager)

Definition at line 226 of file EditorState.cpp.

References CanUndo(), GetComponentTypeID_Static(), m_commandHistory, and m_historyIndex.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_commandHistory

std::deque<std::unique_ptr<Command> > Olympe::Editor::EditorState::m_commandHistory
private

◆ m_historyIndex

size_t Olympe::Editor::EditorState::m_historyIndex
private

◆ m_maxHistorySize

size_t Olympe::Editor::EditorState::m_maxHistorySize
private

Definition at line 172 of file EditorState.h.

Referenced by SetMaxHistorySize(), and TrimHistory().


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