event from c++ to script works (at last...)

This commit is contained in:
Bernhard Amann 2011-10-19 16:35:34 -07:00
parent f8be3519c7
commit 9c8b0dec3b
8 changed files with 33 additions and 16 deletions

View file

@ -1,7 +1,7 @@
#include "InputReader.h"
#include "EventRegistry.h"
#include "Event.h"
// #include "EventRegistry.h"
// #include "Event.h"
InputReader::InputReader()
{
@ -19,13 +19,16 @@ void InputReader::Error(const char *msg)
}
bool InputReader::Init(string source, string eventName) {
EventHandler* handler = event_registry->Lookup(eventName.c_str());
//EventHandler* handler = event_registry->Lookup(eventName.c_str());
//if ( handler == 0 ) {
// reporter->Error("Event %s not found", eventName.c_str());
// return false;
//}
if ( handler == 0 ) {
reporter->Error("Event %s not found", eventName.c_str());
return false;
}
//val_list* vl = new val_list;
//vl->append(new Val(12, TYPE_COUNT));
mgr.Dispatch(new Event(handler, 0));
//mgr.Dispatch(new Event(handler, vl));
return true;
}