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.
planetprovinceloader.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 <unordered_map>
20
21#include "core/universe.h"
22#include "engine/application.h"
23#include "stb_image.h" // NOLINT: The linter is rather annoying with stb
24
25namespace cqsp::client::systems {
27 public:
31 void LoadProvinces();
32
33 private:
34 bool LoadPlanetTexture();
35 bool CheckConditions();
36 void BuildIndexMap();
37 void BuildPlanetTexture();
39
40 entt::entity body;
43
44 std::unordered_map<entt::entity, glm::vec2> position_weights;
45 std::unordered_map<entt::entity, int> mass_sums;
46
47 // stbi information
50 int comp;
51
52 // Counter to assign to the array of colors
54 stbi_uc *image = nullptr;
55};
56} // namespace cqsp::client::systems
Definition: planetprovinceloader.h:26
stbi_uc * image
Definition: planetprovinceloader.h:54
bool LoadPlanetTexture()
Definition: planetprovinceloader.cpp:33
int comp
Definition: planetprovinceloader.h:50
std::unordered_map< entt::entity, glm::vec2 > position_weights
Definition: planetprovinceloader.h:44
entt::entity body
Definition: planetprovinceloader.h:40
~PlanetProvinceLoader()
Definition: planetprovinceloader.cpp:50
bool CheckConditions()
Definition: planetprovinceloader.cpp:48
std::unordered_map< entt::entity, int > mass_sums
Definition: planetprovinceloader.h:45
uint16_t current_province_idx
Definition: planetprovinceloader.h:53
void BuildPlanetTexture()
Definition: planetprovinceloader.cpp:99
PlanetProvinceLoader(engine::Application &app, core::Universe &universe, entt::entity body)
Definition: planetprovinceloader.h:28
void BuildIndexMap()
Definition: planetprovinceloader.cpp:74
core::Universe & universe
Definition: planetprovinceloader.h:41
engine::Application & app
Definition: planetprovinceloader.h:42
int province_height
Definition: planetprovinceloader.h:49
int province_width
Definition: planetprovinceloader.h:48
void GeneratePlanetProvinceMap()
Definition: planetprovinceloader.cpp:145
void LoadProvinces()
Definition: planetprovinceloader.cpp:56
Definition: universe.h:59
Definition: application.h:61
Definition: editorwidgets.cpp:29