package com.livingworld.core.simulation;

import java.util.List;
import java.util.Optional;

import com.livingworld.regions.Region;
import com.livingworld.regions.RegionCoordinate;

/**
 * Manages region resolution and dirty-state tracking.
 * 
 * <p><b>TODO (Milestone 8):</b> Implement actual region loading, unloading,
 * chunk scanning, and persistence integration.</p>
 */
public interface RegionManager {

    /**
     * Resolves a region by its coordinate.
     * 
     * @param coordinate the region coordinate (must not be null)
     * @return an optional containing the region if found, otherwise empty
     */
    Optional<Region> resolve(RegionCoordinate coordinate);

    /**
     * Resolves multiple regions by their coordinates.
     * 
     * @param coordinates list of region coordinates to resolve (must not be null)
     * @return a list of resolved regions (may contain fewer than requested if some are missing)
     */
    List<Region> resolveAll(List<RegionCoordinate> coordinates);

    /**
     * Marks a region as dirty, indicating unsaved changes.
     * 
     * @param region the region to mark dirty (must not be null)
     */
    void markDirty(Region region);
}
