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.
sysproduction.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
21
22namespace cqsp::core::systems {
24 public:
27 void DoSystem() override;
28 int Interval() const override { return ECONOMIC_TICK; }
29
30 private:
31 // Settlement-level processing
32 void ProcessIndustries(Node& node);
33 double ProcessIndustry(Node& industry_node, Node& market_node, components::Market& market, double infra_cost);
34 double ProcessConstruction(Node& industry_node, Node& market_node, components::Market& market);
35 void ScaleConstruction(Node& industry_node, double pl_ratio);
36
37 // Industry FSM
38 void IndustryFsm();
39 void ProductionPreprocessing(entt::entity industry, components::ProductionUnit& production);
40 components::IndustryState SteadyState(entt::entity industry, components::ProductionUnit& production);
43 components::IndustryState Construction(entt::entity industry, components::ProductionUnit& production);
44 components::IndustryState Demolishing(entt::entity industry, components::ProductionUnit& production);
45 components::IndustryState Shrinking(entt::entity industry, components::ProductionUnit& production);
46 components::IndustryState Expanding(entt::entity industry, components::ProductionUnit& production);
47 components::IndustryState Shortage(entt::entity industry, components::ProductionUnit& production);
49
51};
52} // namespace cqsp::core::systems
Wrapper class for all the components of the game, so that all the game stuff can be initialized in on...
Definition: game.h:27
Definition: universe.h:39
Definition: isimulationsystem.h:25
Game & game
Definition: isimulationsystem.h:42
Universe & GetUniverse()
Definition: isimulationsystem.h:39
Definition: sysproduction.h:23
SysProduction(Game &game)
Definition: sysproduction.h:25
components::IndustryState Construction(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:159
void ProcessIndustries(Node &node)
Definition: sysproduction.cpp:257
int Interval() const override
Definition: sysproduction.h:28
components::IndustryState Shrinking(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:179
components::IndustryState Expanding(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:206
double ProcessConstruction(Node &industry_node, Node &market_node, components::Market &market)
Definition: sysproduction.cpp:376
components::IndustryState Demolishing(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:170
void IndustryFsm()
Definition: sysproduction.cpp:51
void DoSystem() override
Definition: sysproduction.cpp:36
void ProductionPreprocessing(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:91
void ScaleConstruction(Node &industry_node, double pl_ratio)
Definition: sysproduction.cpp:411
components::IndustryState MinimumProduction(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:148
components::IndustryState MaximumProduction(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:127
double ProcessIndustry(Node &industry_node, Node &market_node, components::Market &market, double infra_cost)
Definition: sysproduction.cpp:282
double StateToExpertiseGain(components::IndustryState state)
Definition: sysproduction.cpp:240
components::IndustryState Shortage(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:230
const EconomyConfig::ProductionConfig & production_config
Definition: sysproduction.h:50
components::IndustryState SteadyState(entt::entity industry, components::ProductionUnit &production)
Definition: sysproduction.cpp:109
IndustryState
Definition: area.h:58
Definition: basicmaneuver.cpp:23
const int ECONOMIC_TICK
Definition: economyconfig.h:22
Definition: market.h:51