#pragma once

#include <string>
#include <memory>
#include <vector>
#include <Ogre.h>

/**
 * @brief Component for a StaticGeometry region/batch
 * 
 * Entities with StaticGeometryMemberComponent reference this region.
 * The system collects all members and builds the batched geometry.
 */
struct StaticGeometryComponent {
    // Persistent ID for serialization and member references
    std::string regionId;
    
    // Region name for the Ogre::StaticGeometry object
    std::string regionName;
    
    // The actual Ogre StaticGeometry object
    Ogre::StaticGeometry* staticGeometry = nullptr;
    
    // Build configuration
    float renderingDistance = 0.0f;  // 0 = infinite
    bool castShadows = true;
    
    // Optimization settings
    float regionDimensions = 1000.0f;  // Size of each region cell
    std::uint32_t visibilityFlags = 0xFFFFFFFF;
    
    // State
    bool built = false;
    bool dirty = true;  // Needs rebuild
    unsigned int buildVersion = 0;  // Incremented on each build
    
    // List of member entity IDs (for tracking)
    std::vector<std::uint64_t> memberEntityIds;
    
    void markDirty() { 
        dirty = true; 
    }
};
