core/event: Replaced switch statements with virtual functions