SpiecsEngine
 
Loading...
Searching...
No Matches
NativeScriptSystem.cpp
Go to the documentation of this file.
1/**
2* @file NativeScriptSystem.cpp.
3* @brief The NativeScriptSystem Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
9#include "Render/FrameInfo.h"
10#include "World/Components/NativeScriptComponent.h"
11#include "Slate/Imgui/ViewPort/ImguiViewport.h"
12#include "World/World/World.h"
13#include "Core/Event/Event.h"
14#include "SlateSystem.h"
15
16#include "Scripts/ViewPortResizeQuerier.h"
17#include "Scripts/WorldPickIDQuerier.h"
18#include "Scripts/WorldMarkQuerier.h"
19#include "Scripts/MainTaskQuerier.h"
20
21namespace Spices {
22
24 {
25 m_NativeScriptRegister = std::make_unique<NativeScriptRegister>();
26
27 m_NativeScriptRegister->Register<MainTaskQuerier>();
28 m_NativeScriptRegister->Register<ViewPortResizeQuerier>();
29 m_NativeScriptRegister->Register<WorldPickIDQuerier>();
30 m_NativeScriptRegister->Register<WorldMarkQuerier>();
31 }
32
34 {}
35
37 {
39
40 /**
41 * @brief Update NativeScript( C++ );
42 */
43 m_NativeScriptRegister->OnUpdate(ts);
44
45 /**
46 * @brief Update NativeScriptComponent( C++ in world );
47 */
48 FrameInfo::Get().m_World->ViewComponent<NativeScriptComponent>([&](auto e, auto& nsComp){
49 nsComp.OnTick(ts);
50 return false;
51 });
52 }
53
55 {
57
58 m_NativeScriptRegister->OnEvent(event);
59
60 FrameInfo::Get().m_World->ViewComponent<NativeScriptComponent>([&](auto e, auto& nsComp){
61 nsComp.OnEvent(event);
62 return false;
63 });
64 }
65}
#define SPICES_PROFILE_ZONE
This Class is the basic Event Class. Inherit from it and create specific event class.
Definition Event.h:96
static FrameInfo & Get()
Get FrameInfo.
Definition FrameInfo.cpp:14
FrameInfo Class. This class defines the FrameInfo data.
Definition FrameInfo.h:32
NativeScriptComponent Class. This class defines the specific behaves of NativeScriptComponent....
virtual void OnEvent(Event &event) override
This interface defines the behave on global event function pointer is called.
virtual void OnSystemInitialize() override
This interface defines the behave on specific system initialized. Called when system Pushed to System...
virtual void OnSystemUpdate(TimeStep &ts) override
This interface defines the behave on specific system updated every frame.
virtual void OnSystemShutDown() override
This interface defines the behave on specific system shutdown. Called when system poped from SystemMa...
NativeScriptSystem Class. This class defines the specific behaves of NativeScriptSystem.
This Class handles our engine time step during frames. Global Unique.
Definition TimeStep.h:22