45 lines
680 B
C++
45 lines
680 B
C++
#include "Panel.h"
|
|
|
|
#include <utility>
|
|
|
|
namespace XCEngine {
|
|
namespace NewEditor {
|
|
|
|
Panel::Panel(std::string name, bool visible)
|
|
: m_name(std::move(name))
|
|
, m_visible(visible) {
|
|
}
|
|
|
|
Panel::~Panel() = default;
|
|
|
|
const std::string& Panel::GetName() const {
|
|
return m_name;
|
|
}
|
|
|
|
void Panel::SetName(const std::string& name) {
|
|
m_name = name;
|
|
}
|
|
|
|
bool Panel::IsVisible() const {
|
|
return m_visible;
|
|
}
|
|
|
|
void Panel::SetVisible(bool visible) {
|
|
m_visible = visible;
|
|
}
|
|
|
|
void Panel::ToggleVisible() {
|
|
m_visible = !m_visible;
|
|
}
|
|
|
|
void Panel::RenderIfVisible() {
|
|
if (!m_visible) {
|
|
return;
|
|
}
|
|
|
|
Render();
|
|
}
|
|
|
|
} // namespace NewEditor
|
|
} // namespace XCEngine
|