mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 04:30:09 -05:00
Some work on cleaning up Missions
This commit is contained in:
@@ -61,12 +61,10 @@ public:
|
||||
*/
|
||||
const MissionPhase& phase(size_t i) const;
|
||||
|
||||
std::list<const MissionPhase*> phaseTrace(double time, int maxDepth = -1) const;
|
||||
|
||||
//TimeRange parseTimeRange(const ghoul::Dictionary& dict);
|
||||
std::vector<const MissionPhase*> phaseTrace(double time, int maxDepth = -1) const;
|
||||
|
||||
protected:
|
||||
bool phaseTrace(double time, std::list<const MissionPhase*>& trace, int maxDepth) const;
|
||||
bool phaseTrace(double time, std::vector<const MissionPhase*>& trace, int maxDepth) const;
|
||||
|
||||
std::string _name;
|
||||
std::string _description;
|
||||
|
||||
@@ -25,18 +25,15 @@
|
||||
#ifndef __MISSIONPHASEEQUENCER_H__
|
||||
#define __MISSIONPHASEEQUENCER_H__
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <openspace/util/timerange.h>
|
||||
#include <openspace/mission/mission.h>
|
||||
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <ghoul/lua/ghoul_lua.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
namespace scripting { struct LuaLibrary; }
|
||||
|
||||
/**
|
||||
* Singleton class keeping track of space missions.
|
||||
*/
|
||||
@@ -58,7 +55,7 @@ public:
|
||||
* Sets the mission with the name <missionName> as the current mission. The current
|
||||
* mission is what is return by `currentMission()`.
|
||||
*/
|
||||
void setCurrentMission(const std::string missionName);
|
||||
void setCurrentMission(const std::string& missionName);
|
||||
|
||||
/**
|
||||
* Returns true if a current mission exists
|
||||
@@ -76,9 +73,11 @@ private:
|
||||
static scripting::LuaLibrary luaLibrary();
|
||||
static MissionManager* _instance;
|
||||
|
||||
typedef std::unordered_map<std::string, Mission> MissionMap;
|
||||
//typedef std::map<std::string, Mission> MissionMap;
|
||||
using MissionMap = std::map<std::string, Mission>;
|
||||
MissionMap _missionMap;
|
||||
MissionMap::iterator _currentMissionIter;
|
||||
|
||||
MissionMap::iterator _currentMission;
|
||||
|
||||
// Singleton
|
||||
MissionManager();
|
||||
|
||||
Reference in New Issue
Block a user