metaforce/Editor/ProjectManager.hpp

48 lines
1.1 KiB
C++
Raw Normal View History

2016-01-05 09:53:16 +00:00
#ifndef URDE_PROJECT_MANAGER_HPP
#define URDE_PROJECT_MANAGER_HPP
2015-12-13 21:01:32 +00:00
#include <HECL/Database.hpp>
2016-01-05 00:01:02 +00:00
#include <Athena/DNAYaml.hpp>
2016-02-16 05:50:41 +00:00
#include "ProjectResourceFactory.hpp"
#include "Runtime/CSimplePool.hpp"
2015-12-13 21:01:32 +00:00
2016-01-05 09:53:16 +00:00
namespace URDE
2015-12-13 21:01:32 +00:00
{
2016-01-04 05:31:02 +00:00
class ViewManager;
2015-12-13 21:01:32 +00:00
2016-01-05 09:53:16 +00:00
#ifdef URDE_BINARY_CONFIGS
2016-01-05 00:01:02 +00:00
using ConfigReader = Athena::io::IStreamReader;
using ConfigWriter = Athena::io::IStreamWriter;
#else
using ConfigReader = Athena::io::YAMLDocReader;
using ConfigWriter = Athena::io::YAMLDocWriter;
#endif
2015-12-13 21:01:32 +00:00
class ProjectManager
{
2016-01-04 05:31:02 +00:00
ViewManager& m_vm;
std::unique_ptr<HECL::Database::Project> m_proj;
static bool m_registeredSpecs;
2016-02-16 05:50:41 +00:00
ProjectResourceFactory m_factory;
pshag::CSimplePool m_objStore;
void IndexMP1Resources();
2015-12-13 21:01:32 +00:00
public:
2016-01-04 05:31:02 +00:00
ProjectManager(ViewManager& vm);
operator bool() const {return m_proj.operator bool();}
2016-01-07 00:40:27 +00:00
HECL::Database::Project* project() {return m_proj.get();}
2016-01-04 05:31:02 +00:00
bool newProject(const HECL::SystemString& path);
bool openProject(const HECL::SystemString& path);
bool extractGame(const HECL::SystemString& path);
2015-12-13 21:01:32 +00:00
2016-01-05 00:01:02 +00:00
bool saveProject();
2015-12-13 21:01:32 +00:00
};
}
2016-01-05 09:53:16 +00:00
#endif // URDE_PROJECT_MANAGER_HPP