mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Add actions to missions topic
This commit is contained in:
@@ -95,6 +95,8 @@ public:
|
||||
*/
|
||||
const std::vector<MissionPhase>& phases() const;
|
||||
|
||||
const std::vector<std::string> &actions() const;
|
||||
|
||||
using Trace = std::vector<std::reference_wrapper<const MissionPhase>>;
|
||||
|
||||
/**
|
||||
@@ -140,6 +142,8 @@ protected:
|
||||
std::vector<MissionPhase> _subphases;
|
||||
/// Image that is associated with this phase
|
||||
std::string _image;
|
||||
/// Actions associated with the phase
|
||||
std::vector<std::string> _actions;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,6 +60,9 @@ namespace {
|
||||
std::optional<std::string> image;
|
||||
};
|
||||
std::optional<Media> media;
|
||||
|
||||
// Actions associated with this phase
|
||||
std::optional<std::vector<std::string>> actions;
|
||||
};
|
||||
#include "mission_codegen.cpp"
|
||||
} // namespace
|
||||
@@ -141,6 +144,10 @@ MissionPhase::MissionPhase(const ghoul::Dictionary& dictionary) {
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
if (p.actions.has_value()) {
|
||||
_actions = p.actions.value_or(_actions);
|
||||
}
|
||||
}
|
||||
|
||||
const std::string& MissionPhase::name() const {
|
||||
@@ -163,6 +170,10 @@ const std::vector<MissionPhase>& MissionPhase::phases() const {
|
||||
return _subphases;
|
||||
}
|
||||
|
||||
const std::vector<std::string>& MissionPhase::actions() const {
|
||||
return _actions;
|
||||
}
|
||||
|
||||
MissionPhase::Trace MissionPhase::phaseTrace(double time, int maxDepth) const {
|
||||
Trace trace;
|
||||
if (_timeRange.includes(time)) {
|
||||
|
||||
Reference in New Issue
Block a user