public delegate void LuaCsAction(params object[] args);
public class EventService : IEventService
{
// ... assume there're collections up here
public void Add(string eventId, string identifier, params LuaCsAction[] args)
{
var obj = new ExpandoObject();
var mArr = _eventTypes[eventId].GetMethods();
for(int i=0; i<mArr.Length; i++)
{
((IDictionary<string, object>)obj)[mArr[i].Name] = args[i];
}
_eventSubscribers[_eventTypes[eventId]][identifier] = obj; //yes, I'm ommitting the cast.
}
}
public delegate void LuaCsAction(params object[] args);
public class EventService : IEventService
{
// ... assume there're collections up here
public void Add(string eventId, string identifier, params LuaCsAction[] args)
{
var obj = new ExpandoObject();
var mArr = _eventTypes[eventId].GetMethods();
for(int i=0; i<mArr.Length; i++)
{
((IDictionary<string, object>)obj)[mArr[i].Name] = args[i];
}
_eventSubscribers[_eventTypes[eventId]][identifier] = obj; //yes, I'm ommitting the cast.
}
}