Elaztek Developer Hub
Blamite Game Engine - Guerilla (Library)  00406.12.10.23.1457.blamite
The tag editor for the Blamite Game Engine.
projects.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #ifdef GUERILLA_LIB_EXPORTS
7 #define GUERILLA_LIB_API __declspec(dllexport)
8 #else
9 #define GUERILLA_LIB_API __declspec(dllimport)
10 #endif
11 
12 class BlamProject;
13 
14 // The file extension for any Blamite project file.
15 #define PROJECT_FILE_EXTENSION ".blam"
16 
17 // The name of the directory used to store Blamite projects. This folder will always be placed with the engine user data folder.
18 #define BLAM_PROJECTS_DIR "Projects"
19 
27 {
28 private:
32  void ClearChildren();
33 
44  std::vector<BlamTagTreeNode*> GetTagsWithinNode(BlamTagTreeNode* node);
45 
46 public:
47  bool is_folder = false;
48  bool path_exists = false;
49 
50  BlamProject* project = nullptr;
51  BlamTagTreeNode* parent = nullptr;
52  std::vector<BlamTagTreeNode*> children;
53 
54  std::string hierarchy_path = "";
55  std::string disk_path = "";
56  std::string display_name = "";
57  BlamPlugin* plugin = nullptr;
58 
67  BlamTagTreeNode(BlamProject* _project, std::string file_path, bool ignore_folder_name_in_hierarchy, BlamTagTreeNode* parent = nullptr);
68 
72  ~BlamTagTreeNode();
73 
77  void Refresh();
78 
87  std::vector<BlamTagTreeNode*> GetBulkNodeList();
88 };
89 
98 {
99 public:
100  BlamTagTreeNode* hierarchy_root = nullptr;
101 
107  bool project_load_result = false;
108  bool has_project_info = false;
109 
110  std::string project_name = "unnamed";
111  std::string project_root = "";
112  std::string content_root = "tags";
113 
119  BlamProject(std::string file_path);
120  ~BlamProject();
121 
125  void BuildTagHierarchy();
126 };
127 
132 {
140  GUERILLA_LIB_API BlamProject* LoadProject(std::string file_path);
141 
147 
152 
158  GUERILLA_LIB_API std::vector<BlamProject*> GetLoadedProjects();
159 }
BlamTagTreeNode::children
std::vector< BlamTagTreeNode * > children
Any child nodes within this node, will only apply for Folder nodes.
Definition: projects.h:52
BlamProject::content_root
std::string content_root
The root folder containing project content.
Definition: projects.h:112
Guerilla::Projects::LoadProject
GUERILLA_LIB_API BlamProject * LoadProject(std::string file_path)
Loads a project file from disk and prepares it for use.
Definition: projects.cpp:12
BlamProject
Class representing a Blamite Project.
Definition: projects.h:97
tags.h
project_info.h
Guerilla::Projects::GetLoadedProjects
GUERILLA_LIB_API std::vector< BlamProject * > GetLoadedProjects()
Retrieves the list of loaded projects.
Definition: projects.cpp:83
BlamProject::project_info
BlamProjectInfo project_info
The project information file contents.
Definition: projects.h:106
GUERILLA_LIB_API
#define GUERILLA_LIB_API
Definition: projects.h:9
Guerilla::Projects
Namespace containing functions for working with project files.
Definition: projects.h:131
BlamProject::project_load_result
bool project_load_result
Whether or not the project directory exists and is ready for use.
Definition: projects.h:107
BlamProjectInfo
Structure representing a Blam Project Information file.
Definition: project_info.h:33
Guerilla::Projects::UnloadProjects
GUERILLA_LIB_API void UnloadProjects()
Releases all project data loaded into memory.
Definition: projects.cpp:73
BlamPlugin
Class representing a Plugin.
Definition: tags.h:79
loaded_projects
std::vector< BlamProject * > loaded_projects
Definition: projects.cpp:10
projects.h
config.h
BlamTagTreeNode
Class representing a tag tree node.
Definition: projects.h:26
BLAM_PROJECTS_DIR
#define BLAM_PROJECTS_DIR
Definition: projects.h:18
Guerilla::Projects::LoadProjects
GUERILLA_LIB_API void LoadProjects()
Attempts to load all available project folders.
Definition: projects.cpp:29