10#ifndef FOOLSENGINE_APPLICATION_H
11#define FOOLSENGINE_APPLICATION_H
63 template <
typename TObject,
typename=
void>
92 static std::shared_ptr<Application>
instantiate(
const std::string& projectPath);
101 template <
typename TObject>
102 TObject
getObject(
const std::string& path=
"");
127 template <
typename TObject,
typename Enable>
142 TObject
get(
const std::string& path=
"");
149 friend class Application;
157 void initialize(
const nlohmann::json& windowProperties);
204 template <
typename TObject>
209 template <
typename TObject,
typename Enable>
211 static_assert(
false &&
"No getter for this object type is known.");
215 template <
typename TObject>
218 typename
std::enable_if_t<
219 SceneNodeCore::getByPath_Helper<TObject>::s_valid
223 TObject
get(
const std::string& path) {
224 return mApplication->mSceneSystem.lock()->getByPath<TObject>(path);
226 Application* mApplication;
231 assert(path ==
"" &&
"Getter for InputManager does not accept any path parameter");
232 return mApplication->mInputManager;
Base template for engine object getter, used by Application::getObject().
Definition application.hpp:128
TObject get(const std::string &path="")
The actual method used when getting an application object.
Definition application.hpp:210
Application * mApplication
A pointer to the application object, which provides the methods used by the helper to actually fetch ...
Definition application.hpp:148
getByPath_Helper(Application *application)
Create the getByPath_Helper object.
Definition application.hpp:134
SignalTracker mSignalTracker
The signal tracker associated with this object, which broadcasts Application events and receives even...
Definition application.hpp:169
InputManager mInputManager
The input manager associated with this object.
Definition application.hpp:183
static bool s_instantiated
A small static helper variable to determine whether application instantiation has occurred,...
Definition application.hpp:195
Application(const std::string &projectPath)
Constructs a new Application object.
Definition application.cpp:63
static std::weak_ptr< Application > s_pInstance
A pointer to the (sole) instance of the Application for this project.
Definition application.hpp:189
static std::shared_ptr< Application > instantiate(const std::string &projectPath)
Creates the single Application object used by the project and returns a reference to it.
Definition application.cpp:198
SignalTracker & getSignalTracker()
Gets the signal tracker associated with the application.
Definition application.hpp:111
~Application()
Destroys the application object.
Definition application.cpp:194
std::weak_ptr< SceneSystem > mSceneSystem
A pointer to this project's scene system, valid throughout the project.
Definition application.hpp:201
void execute()
Runs the application loop after setup.
Definition application.cpp:114
void initialize(const nlohmann::json &windowProperties)
Initializes this project's 3rd party packages, creates an application window.
Definition application.cpp:211
TObject getObject(const std::string &path="")
Gets an object of a specific type by its scene path.
Definition application.hpp:205
uint32_t mSimulationStep
The simulation step for the application specified in the app's project file.
Definition application.hpp:175
static Application & getInstance()
Gets the (sole) instance of Application for this project.
Definition application.cpp:206
void cleanup()
Clean up of 3rd party packages and window resources, if required.
Definition application.cpp:221
A signal tracker, the main interface between an object and the signal system.
Definition signals.hpp:161
ToyMaker Engine's implementation of an ECS system.
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition application.hpp:24
Contains definitions relating to the render system defined for this object.
Headers relating to resources and their management for a given project.
System classes relating to the SceneSystem, which in some ways lies at the heart of the engine.
Classes relating to this engine's implementation of signals. Contains template classes used to define...
Contains classes and functions for managing the (at present, single) window of this application.