10 #include <nlohmann/json.hpp> 11 #include <entt/entity/registry.hpp> 39 FLING_API
Engine() =
default;
49 template<
class T_GameType,
class T_EditorType = Fling::BaseEditor>
52 template<
class T_GameType>
85 std::shared_ptr<Fling::BaseEditor> m_Editor;
92 template<
class T_GameType,
class T_EditorType>
95 template<
class T_GameType>
100 static_assert(std::is_default_constructible<T_GameType>::value,
"T_GameType requires default-constructible elements");
101 static_assert(std::is_base_of<Fling::Game, T_GameType>::value,
"T_GameType must inherit from Fling::Game");
107 static_assert(std::is_default_constructible<T_EditorType>::value,
"T_EditorType requires default-constructible elements");
108 static_assert(std::is_base_of<Fling::BaseEditor, T_EditorType>::value,
"T_EditorType must inherit from Fling::BaseEditor");
109 m_Editor = std::make_shared<T_EditorType>();
FLING_API UINT64 Run()
Run the engine (Startup, Tick until should stop, and shutdown)
Definition: Engine.h:96
Fling::Game * m_GameImpl
The implementation of the game that this engine is running.
Definition: Engine.h:80
uint64_t UINT64
Definition: FlingTypes.h:14
World * m_World
Persistent world object that can be used to load levels, entities, etc.
Definition: Engine.h:74
Core engine class of Fling.
Definition: Engine.h:35
The game class is mean to be overridden on a per-game instance.
Definition: Game.h:16
The world holds all active levels in the game.
Definition: World.h:21
void Tick()
Initial tick for the engine frame
Definition: Engine.cpp:62
entt::registry g_Registry
Global registry that stores entities and components.
Definition: Engine.h:77
void Startup()
Start any systems or subsystems that may be needed
Definition: Engine.cpp:9
Class that removes the copy operator and constructor.
Definition: NonCopyable.hpp:10
FLING_API ~Engine()=default
FLING_API Engine()=default
void Shutdown()
Shutdown all engine systems and do any necessary cleanup
Definition: Engine.cpp:99