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.
sysmovement.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 <vector>
20
23
24namespace cqsp::common::systems {
26 public:
28 void DoSystem() override;
29 int Interval() override { return 1; }
30
31 private:
32 void ParseOrbitTree(entt::entity parent, entt::entity body);
33
40 void LeaveSOI(const entt::entity& body, entt::entity& parent, components::types::Orbit& orb,
42
49 bool EnterSOI(const entt::entity& parent, const entt::entity& body);
50
58 void CrashObject(components::types::Orbit& orb, entt::entity body, entt::entity parent);
59
60 void UpdateCommandQueue(components::types::Orbit& orb, entt::entity body, entt::entity parent);
61
62 void CalculateImpulse(components::types::Orbit& orb, entt::entity body, entt::entity parent);
63};
64
65class SysPath : public ISimulationSystem {
66 public:
68 void DoSystem();
69 int Interval() { return 1; }
70};
71
73 public:
75 void DoSystem();
76 int Interval() { return 1; }
77};
78} // namespace cqsp::common::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: isimulationsystem.h:25
Game & game
Definition: isimulationsystem.h:42
Definition: sysmovement.h:25
void ParseOrbitTree(entt::entity parent, entt::entity body)
Definition: sysmovement.cpp:153
bool EnterSOI(const entt::entity &parent, const entt::entity &body)
Change the current body's SOI into a child SOI
Definition: sysmovement.cpp:233
void DoSystem() override
Definition: sysmovement.cpp:42
SysOrbit(Game &game)
Definition: sysmovement.h:27
void LeaveSOI(const entt::entity &body, entt::entity &parent, components::types::Orbit &orb, components::types::Kinematics &pos, components::types::Kinematics &p_pos)
Sets the SOI of the entity to the parent
Definition: sysmovement.cpp:48
void UpdateCommandQueue(components::types::Orbit &orb, entt::entity body, entt::entity parent)
Definition: sysmovement.cpp:126
void CalculateImpulse(components::types::Orbit &orb, entt::entity body, entt::entity parent)
Definition: sysmovement.cpp:108
int Interval() override
Definition: sysmovement.h:29
void CrashObject(components::types::Orbit &orb, entt::entity body, entt::entity parent)
Check if the entity has crashed into its parent object
Definition: sysmovement.cpp:79
Definition: sysmovement.h:65
SysPath(Game &game)
Definition: sysmovement.h:67
void DoSystem()
Definition: sysmovement.cpp:220
int Interval()
Definition: sysmovement.h:69
Definition: sysmovement.h:72
SysSurface(Game &game)
Definition: sysmovement.h:74
int Interval()
Definition: sysmovement.h:76
void DoSystem()
Definition: sysmovement.cpp:204
std::string parent
Definition: loadplanets.cpp:55
Definition: simulation.cpp:51
Relative position from the parent orbiting object.
Definition: coordinates.h:32