From 3ac99491cf35b5ea66dc712178cc6838055edcac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Wed, 4 Aug 2021 17:22:14 +0200 Subject: [PATCH] Changed EventDispacher from class to struct --- GlitchyEngine/src/Application.bf | 2 +- GlitchyEngine/src/Events/Event.bf | 2 +- Sandbox/src/SandboxApp.bf | 2 +- Sandbox/src/SandboxApp2D.bf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GlitchyEngine/src/Application.bf b/GlitchyEngine/src/Application.bf index ace9eba..46ed08b 100644 --- a/GlitchyEngine/src/Application.bf +++ b/GlitchyEngine/src/Application.bf @@ -56,7 +56,7 @@ namespace GlitchyEngine if(!_running) return; - EventDispatcher dispatcher = scope .(e); + EventDispatcher dispatcher = EventDispatcher(e); dispatcher.Dispatch(scope => OnWindowClose); for(Layer layer in _layerStack) diff --git a/GlitchyEngine/src/Events/Event.bf b/GlitchyEngine/src/Events/Event.bf index 0aa61ee..babb84e 100644 --- a/GlitchyEngine/src/Events/Event.bf +++ b/GlitchyEngine/src/Events/Event.bf @@ -50,7 +50,7 @@ namespace GlitchyEngine.Events } } - public class EventDispatcher + public struct EventDispatcher { private Event _event; diff --git a/Sandbox/src/SandboxApp.bf b/Sandbox/src/SandboxApp.bf index c8a795c..eb08cd1 100644 --- a/Sandbox/src/SandboxApp.bf +++ b/Sandbox/src/SandboxApp.bf @@ -312,7 +312,7 @@ namespace Sandbox public override void OnEvent(Event event) { - EventDispatcher dispatcher = scope EventDispatcher(event); + EventDispatcher dispatcher = EventDispatcher(event); dispatcher.Dispatch(scope (e) => OnImGuiRender(e)); } diff --git a/Sandbox/src/SandboxApp2D.bf b/Sandbox/src/SandboxApp2D.bf index 543e33e..8983a77 100644 --- a/Sandbox/src/SandboxApp2D.bf +++ b/Sandbox/src/SandboxApp2D.bf @@ -322,7 +322,7 @@ namespace Sandbox public override void OnEvent(Event event) { - EventDispatcher dispatcher = scope EventDispatcher(event); + EventDispatcher dispatcher = EventDispatcher(event); dispatcher.Dispatch(scope (e) => OnImGuiRender(e));