0ad/source/tools/atlas/GameInterface/Handlers/CommandHandlers.cpp
Ykkrosh 001e951066 Autobuilder: Notify autologger of commits.
Interact.cpp: Added category to LOG calls.
Atlas: Renamed all handler source files, so they won't conflict with
other files of the same name. (Fixes bug #77)

This was SVN commit r3721.
2006-04-03 21:08:58 +00:00

47 lines
671 B
C++

#include "precompiled.h"
#include "MessageHandler.h"
#include "../CommandProc.h"
namespace AtlasMessage {
MESSAGEHANDLER(DoCommand)
{
Command* c = NULL;
cmdHandlers::const_iterator it = GetCmdHandlers().find("c" + msg->name);
if (it != GetCmdHandlers().end())
{
c = (it->second)(msg->data);
}
else
{
debug_warn("Unrecognised command");
return;
}
GetCommandProc().Submit(c);
}
MESSAGEHANDLER(UndoCommand)
{
UNUSED2(msg);
GetCommandProc().Undo();
}
MESSAGEHANDLER(RedoCommand)
{
UNUSED2(msg);
GetCommandProc().Redo();
}
MESSAGEHANDLER(MergeCommand)
{
UNUSED2(msg);
GetCommandProc().Merge();
}
}