Elaztek Developer Hub
Blamite Game Engine - Guerilla (Library)  00421.06.29.24.2305.blamite
The tag editor for the Blamite Game Engine.
projects.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Strings/components/resources/project_info/project_info.h>
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 
102  BlamProjectInfo project_info; // The project information file contents.
103  bool project_load_result = false;
104 
105  std::string project_name = "unnamed";
106  std::string project_root = "";
107 
113  BlamProject(std::string file_path);
114  ~BlamProject();
115 
119  void BuildTagHierarchy();
120 
121  std::string GetContentRoot();
122  std::string GetTagsRoot();
123  std::string GetMoviesRoot();
124  std::string GetDataRoot();
125  std::string GetCacheRoot();
126  std::string GetPluginsRoot();
127  std::string GetFontsRoot();
128 };
129 
134 {
137 
145  GUERILLA_LIB_API BlamProject* LoadProject(std::string file_path);
146 
152 
157 
163  GUERILLA_LIB_API std::vector<BlamProject*> GetLoadedProjects();
164 }
BlamProject::GetCacheRoot
std::string GetCacheRoot()
Definition: BlamProject.cpp:200
BlamProject::GetContentRoot
std::string GetContentRoot()
Definition: BlamProject.cpp:148
BlamDatarefValueHintType::C
@ C
C Code.
BlamTagTreeNode::disk_path
std::string disk_path
The path of this node on disk, relative or absolute, ex: ./tags/levels/multi/forge_halo
Definition: projects.h:55
BlamTagTreeNode::children
std::vector< BlamTagTreeNode * > children
Any child nodes within this node, will only apply for Folder nodes.
Definition: projects.h:52
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:23
BlamProject::GetTagsRoot
std::string GetTagsRoot()
Definition: BlamProject.cpp:161
BlamProject
Class representing a Blamite Project.
Definition: projects.h:97
tags.h
BlamTagTreeNode::BlamTagTreeNode
BlamTagTreeNode(BlamProject *_project, std::string file_path, bool ignore_folder_name_in_hierarchy, BlamTagTreeNode *parent=nullptr)
Constructs a new tag tree node.
Definition: BlamTagTreeNode.cpp:8
Guerilla::Projects::GetLoadedProjects
GUERILLA_LIB_API std::vector< BlamProject * > GetLoadedProjects()
Retrieves the list of loaded projects.
Definition: projects.cpp:94
active_project
BlamProject * active_project
Definition: projects.cpp:11
BlamTagTreeNode::plugin
BlamPlugin * plugin
The plugin/tag class this tag uses. Will be nullptr if the node is a directory or if the tag has no p...
Definition: projects.h:57
BlamProject::project_info
BlamProjectInfo project_info
Definition: projects.h:102
render_model_report_type::comment
@ comment
BlamProject::GetDataRoot
std::string GetDataRoot()
Definition: BlamProject.cpp:187
BlamTagTreeNode::path_exists
bool path_exists
Whether or not the path associated with this node exists.
Definition: projects.h:48
BlamProject::GetPluginsRoot
std::string GetPluginsRoot()
Definition: BlamProject.cpp:213
BlamTagTreeNode::Refresh
void Refresh()
Refreshes the node for any changes to its children on disk.
Definition: BlamTagTreeNode.cpp:79
GUERILLA_LIB_API
#define GUERILLA_LIB_API
Definition: projects.h:9
Guerilla::Projects
Namespace containing functions for working with project files.
Definition: projects.h:133
Guerilla::Projects::SetCurrentProject
GUERILLA_LIB_API void SetCurrentProject(BlamProject *project)
Definition: projects.cpp:18
BlamTagTreeNode::display_name
std::string display_name
The display name of this node, ex: forge_halo
Definition: projects.h:56
BlamProject::project_load_result
bool project_load_result
Whether or not the project directory exists and is ready for use.
Definition: projects.h:103
BlamProject::BlamProject
BlamProject(std::string file_path)
Initializes and loads an existing project.
Definition: BlamProject.cpp:8
BlamProject::BuildTagHierarchy
void BuildTagHierarchy()
Builds the tag hierarchy for the project.
Definition: BlamProject.cpp:126
BlamProject::hierarchy_root
BlamTagTreeNode * hierarchy_root
The root node for the project's tag hierarchy.
Definition: projects.h:100
plugins
std::vector< BlamPlugin * > plugins
The list of loaded plugins.
Definition: plugins.cpp:9
BlamTagTreeNode::~BlamTagTreeNode
~BlamTagTreeNode()
Destroys a tag tree node.
Definition: BlamTagTreeNode.cpp:74
BlamProject::GetFontsRoot
std::string GetFontsRoot()
Definition: BlamProject.cpp:226
Guerilla::Tags::GetPluginList
GUERILLA_LIB_API std::vector< BlamPlugin * > GetPluginList()
Retrieves the list of loaded plugins.
Definition: plugins.cpp:132
BlamProject::GetMoviesRoot
std::string GetMoviesRoot()
Definition: BlamProject.cpp:174
BlamTagTreeNode::is_folder
bool is_folder
Indicates whether the node represents a file. If this is false, then the node represents a file.
Definition: projects.h:47
Guerilla::Projects::UnloadProjects
GUERILLA_LIB_API void UnloadProjects()
Releases all project data loaded into memory.
Definition: projects.cpp:84
BlamPlugin
Class representing a Plugin.
Definition: tags.h:80
BlamTagTreeNode::project
BlamProject * project
The project this node belongs to.
Definition: projects.h:50
BlamProject::project_root
std::string project_root
The root folder for the project.
Definition: projects.h:106
loaded_projects
std::vector< BlamProject * > loaded_projects
Definition: projects.cpp:10
BlamProject::project_name
std::string project_name
The name of the project.
Definition: projects.h:105
BlamTagTreeNode::parent
BlamTagTreeNode * parent
The parent node of this node. If this item is the root node, then this will be nullptr.
Definition: projects.h:51
BlamTagTreeNode::hierarchy_path
std::string hierarchy_path
The path of this node within the hierarchy, ex: /levels/multi/forge_halo
Definition: projects.h:54
projects.h
PROJECT_FILE_EXTENSION
#define PROJECT_FILE_EXTENSION
Definition: projects.h:15
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:40
BlamProject::~BlamProject
~BlamProject()
Definition: BlamProject.cpp:121
Guerilla::Projects::GetCurrentProject
GUERILLA_LIB_API BlamProject * GetCurrentProject()
Definition: projects.cpp:13
BlamTagTreeNode::GetBulkNodeList
std::vector< BlamTagTreeNode * > GetBulkNodeList()
Retrieves a bulk list of all tag nodes within this node.
Definition: BlamTagTreeNode.cpp:141