rename engine to src

This commit is contained in:
2018-09-16 14:21:58 +02:00
parent eccb34724e
commit 71de44a7c1
120 changed files with 282 additions and 282 deletions

29
src/action.h Normal file
View File

@@ -0,0 +1,29 @@
#pragma once
class Action
{
public:
bool was_saved = false;
virtual void run() = 0;
virtual void undo() = 0;
virtual Action* get_redo() = 0;
virtual size_t memory() = 0;
virtual ~Action(){};
};
class ActionManager
{
public:
static ActionManager I;
std::stack<std::unique_ptr<Action>> m_actions;
std::stack<std::unique_ptr<Action>> m_redos;
size_t m_memory = 0;
static void add(Action* action);
static void undo();
static void redo();
static void clear();
static bool empty()
{
return I.m_actions.empty();
}
};