Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
ur_scene_manager.hpp
Go to the documentation of this file.
1
11
12#ifndef ZOAPPSCENEMANAGER_H
13#define ZOAPPSCENEMANAGER_H
14
15#define GLM_ENABLE_EXPERIMENTAL
16#include <glm/gtx/string_cast.hpp>
17#include "toymaker/sim_system.hpp"
18
24class UrSceneManager: public ToyMaker::SimObjectAspect<UrSceneManager> {
25public:
26 UrSceneManager(): ToyMaker::SimObjectAspect<UrSceneManager>{0} {}
27 inline static std::string getSimObjectAspectTypeName() { return "UrSceneManager"; }
28 static std::shared_ptr<BaseSimObjectAspect> create(const nlohmann::json& jsonAspectProperties);
29 std::shared_ptr<BaseSimObjectAspect> clone() const override;
30
31 void loadScene(const std::string& sceneResourceName);
32
33private:
34 void onActivated() override;
35 void variableUpdate(uint32_t timeStepMillis) override;
36
37 void loadScene_();
38 void loadAutoloads();
39 void activateAutoloads();
40
41 std::string mNextScene {};
42 std::vector<std::string> mAutoloads {};
43 bool mSwitchScenesThisFrame { false };
44 bool mAutoloadsActivated { false };
45
46 std::vector<std::shared_ptr<ToyMaker::SceneNodeCore>> mRemovedScene {};
47};
48
49#endif
An object containing closely related methods and data, and exposing object lifecycle and application ...
Definition sim_system.hpp:956
void variableUpdate(uint32_t timeStepMillis) override
Overriding this allows an aspect to respond to variable updates.
Definition ur_scene_manager.cpp:31
std::shared_ptr< BaseSimObjectAspect > clone() const override
A method which must be overridden to specify how a new aspect should be constructed as a copy of this...
Definition ur_scene_manager.cpp:10
void loadAutoloads()
Definition ur_scene_manager.cpp:57
void onActivated() override
Callback for when the aspect is activated (after it is attached to an active SimObject,...
Definition ur_scene_manager.cpp:17
void activateAutoloads()
Definition ur_scene_manager.cpp:80