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.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
movement.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 <deque>
20#include <utility>
21
23
25// Datatype returned by a command
26typedef std::pair<glm::dvec3, double> Maneuver_t;
27typedef std::pair<Maneuver_t, Maneuver_t> HohmannPair_t;
28
31struct Maneuver {
39 glm::dvec3 delta_v;
40 double time;
41 Maneuver() = default;
42 explicit Maneuver(const std::pair<glm::dvec3, double>& maneuver) : delta_v(maneuver.first), time(maneuver.second) {}
43 explicit Maneuver(const std::pair<glm::dvec3, double>& maneuver, double current_time)
44 : delta_v(maneuver.first), time(maneuver.second + current_time) {}
45};
46
48 std::deque<Maneuver> maneuvers;
49 std::deque<entt::entity> commands;
50 CommandQueue() = default;
51 auto begin() { return maneuvers.begin(); }
52 auto end() { return maneuvers.end(); }
53};
54} // namespace cqsp::common::components
double second
Definition: units.h:42
Definition: area.h:23
std::pair< glm::dvec3, double > Maneuver_t
Definition: movement.h:26
std::pair< Maneuver_t, Maneuver_t > HohmannPair_t
Definition: movement.h:27
std::deque< entt::entity > commands
Definition: movement.h:49
auto begin()
Definition: movement.h:51
auto end()
Definition: movement.h:52
std::deque< Maneuver > maneuvers
Definition: movement.h:48
Definition: movement.h:31
Maneuver(const std::pair< glm::dvec3, double > &maneuver, double current_time)
Definition: movement.h:43
glm::dvec3 delta_v
Delta v applied with respect to the orbital vector positive y is prograde, negative y is retrograde I...
Definition: movement.h:39
Maneuver(const std::pair< glm::dvec3, double > &maneuver)
Definition: movement.h:42
double time
Definition: movement.h:40