Wizard1393 Posted May 4, 2018 Posted May 4, 2018 Which way is better to work with event handlers? Performance wise? One Event Handler with many iterations of if Event.id == this_event then do this elseif Event.id == that_event then do that end or e.g. one event handler / event? Landing_Event_Handler = {} world.addEventHandler(Landing_Event_Handler) Takeoff_Event_Handler = {} world.addEventHandler(Takeoff_Event_Handler) and then not having to have so many "if" iterations...? GPU: PALIT NVIDIA RTX 3080 10GB | CPU: Intel Core i7-9700K @ 4,9GHz | RAM: 64GB DDR4 3000MHz VR: HP Reverb G2 | HOTAS: TM Warthog Throttle and Stick OS: Windows 10 22H2
Grimes Posted May 4, 2018 Posted May 4, 2018 Don't think it would be a massive difference. But I've never benchmarked it. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts