logic: UndoRedo

UndoRedo working for ActiveTokensMessages
This commit is contained in:
Andreas Stallinger
2015-02-03 10:47:56 +01:00
parent 00f15a2ce3
commit 944554d034
27 changed files with 588 additions and 2 deletions
+1
View File
@@ -11,6 +11,7 @@ template<typename MessageType>
class Message: public MessageBase
{
public:
virtual ~Message()
{
}
+11
View File
@@ -6,11 +6,22 @@
class MessageBase
{
public:
enum UndoType
{
UndoType_Normal,
UndoType_Redo,
UndoType_Undo,
};
MessageBase() : UndoRedoType(UndoType_Normal){};
virtual ~MessageBase()
{
}
virtual std::string getType() const = 0;
virtual void dispatch() = 0;
UndoType UndoRedoType;
};
#endif // MESSAGE_BASE_H
@@ -0,0 +1,20 @@
#ifndef MESSAGE_REDO_H
#define MESSAGE_REDO_H
#include "utility/messaging/Message.h"
#include "utility/types.h"
class MessageRedo: public Message<MessageRedo>
{
public:
MessageRedo()
{
}
static const std::string getStaticType()
{
return "MessageRedo";
}
};
#endif // MESSAGE_REDO_H
@@ -0,0 +1,20 @@
#ifndef MESSAGE_UNDO_H
#define MESSAGE_UNDO_H
#include "utility/messaging/Message.h"
#include "utility/types.h"
class MessageUndo: public Message<MessageUndo>
{
public:
MessageUndo()
{
}
static const std::string getStaticType()
{
return "MessageUndo";
}
};
#endif // MESSAGE_UNDO_H