Changed EventDispacher from class to struct

This commit is contained in:
Simon Lübeß
2021-08-04 17:22:14 +02:00
parent 303578a83f
commit 3ac99491cf
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ namespace GlitchyEngine
if(!_running) if(!_running)
return; return;
EventDispatcher dispatcher = scope .(e); EventDispatcher dispatcher = EventDispatcher(e);
dispatcher.Dispatch<WindowCloseEvent>(scope => OnWindowClose); dispatcher.Dispatch<WindowCloseEvent>(scope => OnWindowClose);
for(Layer layer in _layerStack) for(Layer layer in _layerStack)
+1 -1
View File
@@ -50,7 +50,7 @@ namespace GlitchyEngine.Events
} }
} }
public class EventDispatcher public struct EventDispatcher
{ {
private Event _event; private Event _event;
+1 -1
View File
@@ -312,7 +312,7 @@ namespace Sandbox
public override void OnEvent(Event event) public override void OnEvent(Event event)
{ {
EventDispatcher dispatcher = scope EventDispatcher(event); EventDispatcher dispatcher = EventDispatcher(event);
dispatcher.Dispatch<ImGuiRenderEvent>(scope (e) => OnImGuiRender(e)); dispatcher.Dispatch<ImGuiRenderEvent>(scope (e) => OnImGuiRender(e));
} }
+1 -1
View File
@@ -322,7 +322,7 @@ namespace Sandbox
public override void OnEvent(Event event) public override void OnEvent(Event event)
{ {
EventDispatcher dispatcher = scope EventDispatcher(event); EventDispatcher dispatcher = EventDispatcher(event);
dispatcher.Dispatch<ImGuiRenderEvent>(scope (e) => OnImGuiRender(e)); dispatcher.Dispatch<ImGuiRenderEvent>(scope (e) => OnImGuiRender(e));