Files
XCEngine/editor/src/panels/Panel.h
ssdfasd b0d0576763 Fix editor selection system: SelectionManager ID types and Scene lookup
- SelectionManager now implements ISelectionManager interface with uint64_t IDs
- Remove SelectionManager/SceneManager circular dependency via EventBus
- Add Scene::FindByID() for proper ID-based entity lookup
- SceneManager::GetEntity() now uses FindByID instead of name-based Find
- Fix editor CMakeLists.txt XCEngine.lib path
- EventBus now thread-safe with shared_mutex
2026-03-25 17:51:15 +08:00

47 lines
970 B
C++

#pragma once
#include <string>
#include <memory>
#include <cassert>
namespace XCEngine {
namespace Editor {
class IEditorContext;
class Panel {
public:
Panel(const std::string& name);
virtual ~Panel();
virtual void OnAttach() {}
virtual void OnDetach() {}
virtual void OnUpdate(float dt) {}
virtual void OnEvent(void* event) {}
virtual void Render() = 0;
const std::string& GetName() const { return m_name; }
bool IsOpen() const { return m_isOpen; }
void SetOpen(bool open) { m_isOpen = open; }
void Toggle() { m_isOpen = !m_isOpen; }
void SetContext(IEditorContext* context) {
assert(!m_context && "Context already set!");
m_context = context;
}
IEditorContext* GetContext() const {
return m_context;
}
bool HasContext() const { return m_context != nullptr; }
protected:
std::string m_name;
bool m_isOpen;
IEditorContext* m_context = nullptr;
};
}
}