package com.livingworld.core.simulation;

import java.util.Optional;

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

/**
 * Handles region persistence (save/load) and migration support.
 * 
 * <p><b>TODO (Milestone 8):</b> Implement actual file or database I/O,
 * platform-specific save paths, and schema versioning.</p>
 */
public interface PersistenceService {

    /**
     * Saves a region to persistent storage.
     * 
     * @param region the region to save (must not be null)
     */
    void save(Region region);

    /**
     * Loads a region from persistent storage.
     * 
     * @param coordinate the region coordinate to load (must not be null)
     * @return an optional containing the loaded region if found, otherwise empty
     */
    Optional<Region> load(RegionCoordinate coordinate);

    /**
     * Returns whether this persistence service supports data migration.
     * 
     * <p><b>TODO:</b> Implement schema version detection and migration logic.</p>
     * 
     * @return true if migration is supported
     */
    boolean supportsMigration();
}
