using System;

namespace NcProgramManager.Cnc.Fanuc
{
    internal static class FocasDialectFactory
    {
        public static IFocasDialect Create(FanucCapabilities caps)
        {
            if (caps == null) return new LegacyFocasDialect();
            switch (caps.Dialect)
            {
                case FanucDialect.Modern: return new ModernFocasDialect();
                case FanucDialect.Legacy:
                case FanucDialect.Unknown:
                    return new LegacyFocasDialect();
                default:
                    throw new InvalidOperationException("Unsupported FanucDialect: " + caps.Dialect);
            }
        }
    }
}
