Load the previously loaded project and scene on startup

(read from an ini file)
This commit is contained in:
2023-01-14 21:44:48 +01:00
parent 145338d666
commit 282844b905
11 changed files with 85 additions and 49 deletions

View File

@ -1,6 +1,10 @@
#pragma once
#include <filesystem>
#include <iostream>
#include "../../YoggieEngine/src/YoggieEngine.h"
#include <yaml-cpp/yaml.h>
class Project {
public:
Project() = default;
@ -13,10 +17,21 @@ public:
void setProjectDirectory(std::string& path) { ProjectDirectory = std::filesystem::path(path); }
const std::filesystem::path GetProjectDirectory() { return ProjectDirectory; }
void AddScene(YoggieEngine::Scene& scene)
{
Scenes.push_back(&scene);
}
static void SaveProject(std::filesystem::path path, Project& project);
static void LoadProject(std::filesystem::path path, Project& project);
private:
std::string Name;
std::filesystem::path ProjectDirectory;
std::vector<YoggieEngine::Scene*> Scenes;
friend class YAML::convert<Project>;
};