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.
simulation.h
Go to the documentation of this file.
1/* Conquer Space
2 * Copyright (C) 2021-2023 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#include <vector>
21
22#include "common/game.h"
24
25namespace cqsp {
26namespace common {
27namespace systems {
28namespace simulation {
39 public:
40 explicit Simulation(cqsp::common::Game &game);
41
45 void tick();
46
47 template <class T>
48 void AddSystem() {
49 static_assert(std::is_base_of<cqsp::common::systems::ISimulationSystem, T>::value);
50 system_list.push_back(std::make_unique<T>(m_game));
51 }
52
53 private:
58 std::vector<std::unique_ptr<cqsp::common::systems::ISimulationSystem>> system_list;
60};
61} // namespace simulation
62} // namespace systems
63} // namespace common
64} // namespace cqsp
Wrapper class for all the components of the game, so that all the game stuff can be initialized in on...
Definition: game.h:28
Definition: universe.h:32
Main simulation of game. /summary> To add a simulation in the game, add a class extending from cqsp::...
Definition: simulation.h:38
cqsp::common::Universe & m_universe
Definition: simulation.h:59
Simulation(cqsp::common::Game &game)
Definition: simulation.cpp:52
void tick()
1 game tick, runs every single system that is added.
Definition: simulation.cpp:75
cqsp::common::Game & m_game
Definition: simulation.h:54
void AddSystem()
Definition: simulation.h:48
std::vector< std::unique_ptr< cqsp::common::systems::ISimulationSystem > > system_list
Holds all the systems.
Definition: simulation.h:58
When adding assets, it is extremely crucial that you read cqsp::asset::AssetLoader::LoadResources to ...
Definition: clientctx.h:21