#pragma once

/*
	GameEngine and Editor
	by John Ryland
	Copyright (c) 2023
*/

////////////////////////////////////////////////////////////////////////////////////
//	Entity Tree Property Editor View

#include "IView.h"
#include "EcsSystem.h"

namespace GameEngine {

class SceneObject;

class EntityTreePropertyEditorView : public IView
{
public:
    EntityTreePropertyEditorView(EcsSystem& entityComponentSystem)
        : m_entityComponentSystem(entityComponentSystem)
    {
    }

    void AddShowMenuItem() override;

    void Initialize() override;
    void Shutdown() override;
    void Update() override;

    void ShowObjectTree();
    void ShowEntityProperties();

private:
    void AddTreeNode(SceneObject* sceneObj);

    bool              m_showObjectTreeView = true;
    bool              m_showPropertyEditor = true;
    ComponentTypeId   m_sceneObjectId;         // SceneObject component type's id  (cache)
    EntityId          m_selectedEntityId = 0;
    EcsSystem&        m_entityComponentSystem;
};

} // GameEngine namespace
