Well, you can have an array of event factories:

IEvent function()[2] factories = [ factory1, factory2 ];

IEvent factory1() { return new Event1(); }
IEvent factory2() { return new Event2(); }

Then use enum for indexing:
IEvent e = factories[NumEvent1]();

Reply via email to