#pragma once

#include <string>
#include <flecs.h>

/**
 * @brief Component for entities that should be batched into StaticGeometry
 * 
 * This component stores mesh data and references the StaticGeometry region entity.
 * The actual Ogre::Entity is NOT created on a SceneNode - instead, the data is
 * used to add geometry to the StaticGeometry batch.
 * 
 * Position and Orientation are taken from TransformComponent's SceneNode (_getDerived*).
 * Scale is also taken from TransformComponent.
 */
struct StaticGeometryMemberComponent {
    // Reference to the StaticGeometry region entity (runtime only)
    flecs::entity regionEntity;
    
    // Persistent ID for serialization (references StaticGeometryComponent::regionId)
    std::string regionId;
    
    // Mesh data (stored here, not in RenderableComponent)
    std::string meshName;
    std::string materialName;  // Empty = use mesh default
    
    // LOD settings reference (must be same for all members in a region)
    std::string lodSettingsId;
    flecs::entity lodSettingsEntity;
    
    // Configuration
    bool castShadows = true;
    bool visible = true;
    
    // Dirty flag - triggers region rebuild when changed
    bool dirty = true;
    
    // Version tracking for transform changes
    unsigned int transformVersion = 0;
    
    void markDirty() { 
        dirty = true; 
        transformVersion++;
    }
};
