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="cura"):
    """
    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()
    elif engine_name in ['prusa', 'prusa_slicer', 'prusaslicer']:
        return PrusaSlicerEngine()
    else:
        # Default fallback
        return CuraEngine()
