mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 04:27:42 +00:00
New code style refactor
This commit is contained in:
@@ -3,8 +3,7 @@
|
||||
#include "hecl/Database.hpp"
|
||||
#include "Space.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
namespace urde {
|
||||
|
||||
/** Combines a ProjectPath with actively used Space references
|
||||
*
|
||||
@@ -15,34 +14,33 @@ namespace urde
|
||||
* The key purpose of this class is to centrally register observer-nodes for resources that
|
||||
* are updated via editing, or external file changes.
|
||||
*/
|
||||
class Resource
|
||||
{
|
||||
class Resource {
|
||||
public:
|
||||
using ProjectDataSpec = hecl::Database::Project::ProjectDataSpec;
|
||||
using ProjectDataSpec = hecl::Database::Project::ProjectDataSpec;
|
||||
|
||||
private:
|
||||
hecl::ProjectPath m_path;
|
||||
Space::Class m_defaultClass = Space::Class::None;
|
||||
//EditorSpace* m_editingSpace = nullptr;
|
||||
std::vector<ViewerSpace*> m_viewingSpaces;
|
||||
hecl::ProjectPath m_path;
|
||||
Space::Class m_defaultClass = Space::Class::None;
|
||||
// EditorSpace* m_editingSpace = nullptr;
|
||||
std::vector<ViewerSpace*> m_viewingSpaces;
|
||||
|
||||
public:
|
||||
static Space::Class DeduceDefaultSpaceClass(const hecl::ProjectPath& path);
|
||||
explicit Resource(hecl::ProjectPath&& path)
|
||||
: m_path(std::move(path)), m_defaultClass(DeduceDefaultSpaceClass(m_path)) {}
|
||||
const hecl::ProjectPath& path() const {return m_path;}
|
||||
static Space::Class DeduceDefaultSpaceClass(const hecl::ProjectPath& path);
|
||||
explicit Resource(hecl::ProjectPath&& path)
|
||||
: m_path(std::move(path)), m_defaultClass(DeduceDefaultSpaceClass(m_path)) {}
|
||||
const hecl::ProjectPath& path() const { return m_path; }
|
||||
};
|
||||
|
||||
/** Provides centralized hierarchical lookup and ownership of Resource nodes */
|
||||
class ResourceTree
|
||||
{
|
||||
class ResourceTree {
|
||||
public:
|
||||
struct Node
|
||||
{
|
||||
std::map<hecl::ProjectPath, std::unique_ptr<Node>> m_subnodes;
|
||||
std::map<hecl::ProjectPath, std::unique_ptr<Resource>> m_resources;
|
||||
};
|
||||
struct Node {
|
||||
std::map<hecl::ProjectPath, std::unique_ptr<Node>> m_subnodes;
|
||||
std::map<hecl::ProjectPath, std::unique_ptr<Resource>> m_resources;
|
||||
};
|
||||
|
||||
private:
|
||||
std::unique_ptr<Node> m_rootNode;
|
||||
std::unique_ptr<Node> m_rootNode;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} // namespace urde
|
||||
|
||||
Reference in New Issue
Block a user