#pragma once

#include "ComponentEditor.hpp"
#include <string>
#include <unordered_map>

struct RoomComponent;

class RoomEditor : public ComponentEditor<RoomComponent> {
public:
    bool renderComponent(flecs::entity entity, RoomComponent& room) override;
    const char* getName() const override { return "Room"; }

private:
    // Format a room label for display in connection lists
    // Format: "Name [E:entityId P:persistentId] (Type)"
    std::string formatRoomLabel(flecs::entity entity, const RoomComponent& room);
    
    // Check if two rooms are adjacent (share at least one edge)
    bool areRoomsAdjacent(const RoomComponent& roomA, const RoomComponent& roomB);
    
    // Track selected room index per entity to avoid static variable issues
    std::unordered_map<flecs::entity_t, int> m_selectedRoomIndex;
};
