5#include "../include/EditorState.h"
16 : m_prefabPath(prefabPath), m_position(position), m_entityId(
"")
50 : m_x(x), m_y(y), m_newTileId(
newTileId), m_oldTileId(-1)
72 return "Set Tile at (" + std::to_string(
m_x) +
", " + std::to_string(
m_y) +
")";
80 : m_entityId(entityId), m_newPosition(
newPosition), m_oldPosition(0, 0, 0)
111 : m_entityId(entityId), m_savedEntity(
nullptr)
161 : m_x(x), m_y(y), m_newMask(
newMask), m_oldMask(0)
180 return "Set Collision at (" + std::to_string(
m_x) +
", " + std::to_string(
m_y) +
")";
188 : m_historyIndex(0), m_maxHistorySize(100)
200 std::cerr <<
"[EditorState] Attempted to execute null command" << std::endl;
223 std::cout <<
"[EditorState] Command executed: " <<
m_commandHistory.back()->GetDescription() << std::endl;
286 std::cout <<
"[EditorState] History cleared" << std::endl;
ComponentTypeID GetComponentTypeID_Static()
std::string GetDescription() const override
DeleteEntityCommand(const std::string &entityId)
std::unique_ptr< EntityInstance > m_savedEntity
void Undo(LevelManager &levelManager) override
void Execute(LevelManager &levelManager) override
bool Redo(LevelManager &levelManager)
bool Undo(LevelManager &levelManager)
std::string GetRedoDescription() const
void ExecuteCommand(std::unique_ptr< Command > command, LevelManager &levelManager)
std::deque< std::unique_ptr< Command > > m_commandHistory
std::string GetUndoDescription() const
MoveEntityCommand(const std::string &entityId, const Vector &newPosition)
std::string GetDescription() const override
void Execute(LevelManager &levelManager) override
void Undo(LevelManager &levelManager) override
void Undo(LevelManager &levelManager) override
PlaceEntityCommand(const std::string &prefabPath, const Vector &position)
std::string GetDescription() const override
void Execute(LevelManager &levelManager) override
SetCollisionCommand(int x, int y, uint8_t newMask)
void Execute(LevelManager &levelManager) override
void Undo(LevelManager &levelManager) override
std::string GetDescription() const override
void Execute(LevelManager &levelManager) override
std::string GetDescription() const override
void Undo(LevelManager &levelManager) override
SetTileCommand(int x, int y, int newTileId)