Migrate ProjectManager to dependency injection

- Created IProjectManager interface
- ProjectManager now implements IProjectManager
- Removed ProjectManager::Get() singleton
- Added IEditorContext::GetProjectManager()
- ProjectPanel now uses m_context->GetProjectManager() instead of singleton
- EditorContext owns ProjectManager instance
This commit is contained in:
2026-03-25 16:25:55 +08:00
parent 56116b62c3
commit d4c94907ba
7 changed files with 98 additions and 35 deletions

View File

@@ -8,6 +8,7 @@ namespace Editor {
class EventBus;
class ISelectionManager;
class IProjectManager;
class IEditorContext {
public:
@@ -16,6 +17,7 @@ public:
virtual EventBus& GetEventBus() = 0;
virtual ISelectionManager& GetSelectionManager() = 0;
virtual void* GetSceneManager() = 0;
virtual IProjectManager& GetProjectManager() = 0;
virtual void SetProjectPath(const std::string& path) = 0;
virtual const std::string& GetProjectPath() const = 0;