31 lines
795 B
C
31 lines
795 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
#include "IComponentEditor.h"
|
||
|
|
|
||
|
|
#include <memory>
|
||
|
|
#include <string>
|
||
|
|
#include <unordered_map>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
namespace XCEngine {
|
||
|
|
namespace Editor {
|
||
|
|
|
||
|
|
class ComponentEditorRegistry {
|
||
|
|
public:
|
||
|
|
static ComponentEditorRegistry& Get();
|
||
|
|
|
||
|
|
void RegisterEditor(std::unique_ptr<IComponentEditor> editor);
|
||
|
|
IComponentEditor* FindEditor(::XCEngine::Components::Component* component) const;
|
||
|
|
IComponentEditor* FindEditorByTypeName(const std::string& componentTypeName) const;
|
||
|
|
const std::vector<std::unique_ptr<IComponentEditor>>& GetEditors() const;
|
||
|
|
|
||
|
|
private:
|
||
|
|
ComponentEditorRegistry();
|
||
|
|
|
||
|
|
std::vector<std::unique_ptr<IComponentEditor>> m_editors;
|
||
|
|
std::unordered_map<std::string, IComponentEditor*> m_editorsByType;
|
||
|
|
};
|
||
|
|
|
||
|
|
} // namespace Editor
|
||
|
|
} // namespace XCEngine
|