from .cura_engine import CuraEngine
from .prusa_slicer_engine import PrusaSlicerEngine

def get_all_engines():
    """Returns a list of instantiated engines."""
    return [
        CuraEngine(),
        PrusaSlicerEngine()
    ]

def get_slicer_engine(engine_name="prusa", print_config_folder=None, config_slice_bin_path=None):
    """
    Factory function to retrieve the requested slicing engine instance.
    Valid names: 'cura', 'prusa_slicer'
    """
    engine_name = engine_name.lower().strip()
    
    if engine_name in ['cura', 'cura_engine', 'curaengine']:
        return CuraEngine(print_config_folder)
    elif engine_name in ['prusa', 'prusa_slicer', 'prusaslicer']:
        return PrusaSlicerEngine(print_config_folder, config_slice_bin_path)
    else:
        # Default fallback
        return PrusaSlicerEngine(print_config_folder, config_slice_bin_path)
