#pragma once
#include <stack>
#include "Event.h"
class Buffer;
/// Store events and handle undo/redo
class History {
std::stack<Event*> m_done;
std::stack<Event*> m_undone;
/// True when in undo() or redo()
bool m_working = false;
public:
/// Add an event to history
void log_event(Event* ev);
/// Undo latest event
bool undo(Buffer& buf);
/// Redo latest event
bool redo(Buffer& buf);
};