using System;
using ChuPiao.AutoPrint.Machine.TjJingCaiV1;

using ChuPiao.Common.Enums;

namespace ChuPiao.AutoPrint.Machine
{
    /// <summary>
    /// 彩票机工厂
    /// </summary>
    public class LotMachineFactory
    {
        public ILotMachine CreateLotMachine(int machineType)
        {
            MachineType type = (MachineType)(Enum.Parse(typeof(MachineType), machineType.ToString()));
            ILotMachine lotMachine = null;
            switch (type)
            {
                case MachineType.JingCaiV1:
                    lotMachine = new TjJingCaiMachineV1();
                    break;
                default:
                    throw new Exception(string.Concat("彩票机类型未定义：", machineType));
            }
            return lotMachine;
        }
    }
}
