logic: UndoRedo
UndoRedo working for ActiveTokensMessages
This commit is contained in:
@@ -11,6 +11,7 @@ template<typename MessageType>
|
||||
class Message: public MessageBase
|
||||
{
|
||||
public:
|
||||
|
||||
virtual ~Message()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user