Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
scenemanager.h
Go to the documentation of this file.
1/* Conquer Space
2* Copyright (C) 2021 Conquer Space
3*
4* This program is free software: you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation, either version 3 of the License, or
7* (at your option) any later version.
8*
9* This program is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with this program. If not, see <https://www.gnu.org/licenses/>.
16*/
17#pragma once
18
19#include <memory>
20
21namespace cqsp {
22namespace engine {
23class Scene;
24
29 public:
34 void SetInitialScene(std::unique_ptr<Scene> scene);
35
39 void SetScene(std::unique_ptr<Scene> scene);
40
44 void SwitchScene();
45
50 Scene* GetScene();
51
56 bool ToSwitchScene() { return (m_switch && m_next_scene != nullptr); }
57
58 void Update(float deltaTime);
59
60 void Ui(float deltaTime);
61
62 void Render(float deltaTime);
63
64 void DeleteCurrentScene();
65
66 private:
67 std::unique_ptr<Scene> m_scene;
68 std::unique_ptr<Scene> m_next_scene;
69
74};
75} // namespace engine
76} // namespace cqsp
Definition: scene.h:27
Manages scenes for the application.
Definition: scenemanager.h:28
void SwitchScene()
Sets the next scene to the current.
Definition: scenemanager.cpp:36
void Render(float deltaTime)
Definition: scenemanager.cpp:58
bool ToSwitchScene()
Verifies if it is appropiate to switch scenes.
Definition: scenemanager.h:56
void SetInitialScene(std::unique_ptr< Scene > scene)
Sets the current scene.
Definition: scenemanager.cpp:29
void SetScene(std::unique_ptr< Scene > scene)
Sets the next scene, and the scene will be switched when SwitchScene is executed.
Definition: scenemanager.cpp:31
std::unique_ptr< Scene > m_scene
Definition: scenemanager.h:67
bool m_switch
If the next scene has been set.
Definition: scenemanager.h:73
void Update(float deltaTime)
Definition: scenemanager.cpp:48
void DeleteCurrentScene()
Definition: scenemanager.cpp:46
Scene * GetScene()
Gets current running scene.
Definition: scenemanager.cpp:44
std::unique_ptr< Scene > m_next_scene
Definition: scenemanager.h:68
void Ui(float deltaTime)
Definition: scenemanager.cpp:53
When adding assets, it is extremely crucial that you read cqsp::asset::AssetLoader::LoadResources to ...
Definition: clientctx.h:21