Elaztek Developer Hub
Blamite Game Engine - Strings  00315.05.27.21.0015.blamite
A library containing general purpose utilities and classes for use in multiple projects.
projects.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #ifdef STRINGS_EXPORTS
7 #define STRINGS_API __declspec(dllexport)
8 #else
9 #define STRINGS_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 user's Documents folder.
18 #define BLAM_PROJECTS_DIR "Blamite 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 
109  void BuildTagHierarchy();
110 };
111 
116 {
124  STRINGS_API BlamProject* LoadProject(std::string file_path);
125 
130  STRINGS_API void LoadProjects();
131 
136 
142  STRINGS_API std::vector<BlamProject*> GetLoadedProjects();
143 }
BlamTagTreeNode::children
std::vector< BlamTagTreeNode * > children
Any child nodes within this node, will only apply for Folder nodes.
Definition: projects.h:42
Guerilla::Projects::LoadProject
STRINGS_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
project_info.h
Guerilla::Projects::GetLoadedProjects
STRINGS_API std::vector< BlamProject * > GetLoadedProjects()
Retrieves the list of loaded projects.
Definition: projects.cpp:86
BlamProject::project_info
BlamProjectInfo project_info
The project information file contents.
Definition: projects.h:88
tags.h
Guerilla::Projects
Namespace containing functions for working with project files.
Definition: projects.h:115
STRINGS_API
#define STRINGS_API
Definition: projects.h:9
BlamProjectInfo
Structure representing a Blam Project Information file.
Definition: project_info.h:33
Guerilla::Projects::UnloadProjects
STRINGS_API void UnloadProjects()
Releases all project data loaded into memory.
Definition: projects.cpp:76
BlamPlugin
Class representing a Plugin.
Definition: tags.h:34
BlamTagTreeNode
Class representing a tag tree node.
Definition: projects.h:26
Guerilla::Projects::LoadProjects
STRINGS_API void LoadProjects()
Attempts to load all available project folders.
Definition: projects.cpp:28