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.
universescene.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2025 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 <array>
20#include <memory>
21#include <utility>
22#include <vector>
23
29#include "core/simulation.h"
30#include "engine/application.h"
34
35namespace cqsp::client::scene {
37 public:
38 explicit UniverseScene(engine::Application& app, std::unique_ptr<systems::SysStarSystemRenderer>,
39 std::unique_ptr<cqsp::core::systems::simulation::Simulation>);
40 ~UniverseScene() = default;
41
42 void Init();
43 void Update(float deltaTime);
44 void Ui(float deltaTime);
45 void Render(float deltaTime);
46
47 template <class T>
48 void AddUISystem() {
49 auto ui = std::make_unique<T>(GetApp());
50 ui->Init();
51 user_interfaces.push_back(std::move(ui));
52 }
53
54 private:
55 void DoScreenshot();
56
58
59 void ManageTick();
60
61 std::unique_ptr<systems::SysStarSystemRenderer> system_renderer;
62 std::unique_ptr<cqsp::core::systems::simulation::Simulation> simulation;
63 std::vector<std::unique_ptr<cqsp::client::systems::SysUserInterface>> user_interfaces;
64
65 double last_tick = 0;
66
67 void ToggleTick();
68
69 bool interp = true;
70};
71
72void SeePlanet(core::Universe& universe, entt::entity ent);
74// Halts all other things
75void SetGameHalted(bool b);
76bool IsGameHalted();
77} // namespace cqsp::client::scene
Definition: rmlscene.h:26
Definition: universescene.h:36
UniverseScene(engine::Application &app, std::unique_ptr< systems::SysStarSystemRenderer >, std::unique_ptr< cqsp::core::systems::simulation::Simulation >)
Definition: universescene.cpp:62
void Render(float deltaTime)
Definition: universescene.cpp:137
void AddUISystem()
Definition: universescene.h:48
void Ui(float deltaTime)
Definition: universescene.cpp:130
void DoScreenshot()
Definition: universescene.cpp:143
bool interp
Definition: universescene.h:69
std::vector< std::unique_ptr< cqsp::client::systems::SysUserInterface > > user_interfaces
Definition: universescene.h:63
void InitializeScriptFunctions()
Definition: universescene.cpp:208
void ToggleTick()
Definition: universescene.cpp:190
std::unique_ptr< cqsp::core::systems::simulation::Simulation > simulation
Definition: universescene.h:62
double last_tick
Definition: universescene.h:65
void Update(float deltaTime)
Definition: universescene.cpp:98
void ManageTick()
Definition: universescene.cpp:151
std::unique_ptr< systems::SysStarSystemRenderer > system_renderer
Definition: universescene.h:61
void Init()
Definition: universescene.cpp:66
Definition: universe.h:59
Definition: application.h:61
Application & GetApp()
Definition: scene.h:33
core::Universe & universe
Definition: explorationwindow.h:3
Definition: loadingscene.cpp:43
void SetGameHalted(bool b)
Definition: universescene.cpp:204
entt::entity GetCurrentViewingPlanet(core::Universe &universe)
Definition: universescene.cpp:195
bool IsGameHalted()
Definition: universescene.cpp:206
void SeePlanet(core::Universe &universe, entt::entity ent)
Definition: universescene.cpp:199