Elaztek Developer Hub
Blamite Game Engine - Guerilla (Library)  00390.07.02.23.1947.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 
34  std::vector<BlamTagTreeNode*> GetTagsWithinNode(BlamTagTreeNode* node);
35 
36 public:
37  bool is_folder = false;
38  bool path_exists = false;
39 
40  BlamProject* project = nullptr;
41  BlamTagTreeNode* parent = nullptr;
42  std::vector<BlamTagTreeNode*> children;
43 
44  std::string hierarchy_path = "";
45  std::string disk_path = "";
46  std::string display_name = "";
47  BlamPlugin* plugin = nullptr;
48 
57  BlamTagTreeNode(BlamProject* _project, std::string file_path, bool ignore_folder_name_in_hierarchy, BlamTagTreeNode* parent = nullptr);
58 
62  ~BlamTagTreeNode();
63 
67  void Refresh();
68 
69  std::vector<BlamTagTreeNode*> GetBulkNodeList();
70 };
71 
80 {
81 public:
82  BlamTagTreeNode* hierarchy_root = nullptr;
83 
89  bool project_load_result = false;
90  bool has_project_info = false;
91 
92  std::string project_name = "unnamed";
93  std::string project_root = "";
94  std::string content_root = "tags";
95 
101  BlamProject(std::string file_path);
102  ~BlamProject();
103 
107  void BuildTagHierarchy();
108 };
109 
114 {
122  GUERILLA_LIB_API BlamProject* LoadProject(std::string file_path);
123 
129 
134 
140  GUERILLA_LIB_API std::vector<BlamProject*> GetLoadedProjects();
141 }
BlamTagTreeNode::children
std::vector< BlamTagTreeNode * > children
Any child nodes within this node, will only apply for Folder nodes.
Definition: projects.h:42
BlamProject::content_root
std::string content_root
The root folder containing project content.
Definition: projects.h:94
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:79
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:88
GUERILLA_LIB_API
#define GUERILLA_LIB_API
Definition: projects.h:9
Guerilla::Projects
Namespace containing functions for working with project files.
Definition: projects.h:113
BlamProject::project_load_result
bool project_load_result
Whether or not the project directory exists and is ready for use.
Definition: projects.h:89
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