Finality Engine
Loading...
Searching...
No Matches
Project.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <Core/Core.h>
14#include <filesystem>
15#include <string>
16#include "ProjectSettings.h"
17
18namespace FINALITY
19{
30 {
31 public:
32 bool Create(const std::filesystem::path& location, const std::string& name,
33 const std::filesystem::path& templateAssets = {}, bool starterTemplate = true);
34 bool Open(const std::filesystem::path& path);
35 bool Save() const;
36 bool SaveSettings() const;
38 void SetName(const std::string& name) { if (!name.empty()) m_Name = name; }
39 bool IsOpen() const { return !m_Path.empty(); }
40 const std::filesystem::path& GetPath() const { return m_Path; }
41 std::filesystem::path GetDirectory() const { return m_Path.parent_path(); }
42 std::filesystem::path GetAssetsDirectory() const { return GetDirectory() / "Assets"; }
43 const std::string& GetName() const { return m_Name; }
44 std::string StartupScene = "Assets/Scenes/Main.fscene";
46
47 private:
48 std::filesystem::path m_Path;
49 std::string m_Name;
50 };
51}
#define FAPI
Definition Core.h:22
Owns project identity, paths and saved configuration.
Definition Project.h:30
const std::string & GetName() const
Definition Project.h:43
void SetName(const std::string &name)
Definition Project.h:38
std::string StartupScene
Definition Project.h:44
bool IsOpen() const
Definition Project.h:39
std::filesystem::path GetAssetsDirectory() const
Definition Project.h:42
const std::filesystem::path & GetPath() const
Definition Project.h:40
bool Create(const std::filesystem::path &location, const std::string &name, const std::filesystem::path &templateAssets={}, bool starterTemplate=true)
bool SaveSettings() const
bool Open(const std::filesystem::path &path)
ProjectSettings Settings
Definition Project.h:45
bool Save() const
std::filesystem::path GetDirectory() const
Definition Project.h:41