Пример #1
0
    private void GetAnteCodes(int playTypeValue, string numbers, out BuyType buyType, out List<string> anteCodes)
    {
        GetAnteCode action;
        switch (playTypeValue)
        {
            case 2901:  // 直选单式
                buyType = BuyType.B201;
                action = new GetAnteCode(GetSingleCodeFormat);
                break;
            case 2902:  // 直选复式
                buyType = BuyType.B208;
                action = new GetAnteCode(GetManyCodeFormat);
                break;
            case 2903:  // 组选单式
                buyType = BuyType.B202;
                action = new GetAnteCode(GetSingleCodeFormat);
                break;
            //case 2904:  // 组选6
            //    buyType = BuyType.B230;
            //    action = new GetAnteCode(GetSingleCodeFormat);
            //    break;
            //case 2905:  // 组选3
            //    buyType = BuyType.B230;
            //    action = new GetAnteCode(GetSingleCodeFormat);
            //    break;
            case 2908:  // 前二单式
                buyType = BuyType.B201;
                action = new GetAnteCode(GetSingleCodeFormat_Left);
                break;
            case 2909:  // 前二复式
                buyType = BuyType.B208;
                action = new GetAnteCode(GetManyCodeFormat_Left2);
                break;
            case 2910:  // 后二单式
                buyType = BuyType.B201;
                action = new GetAnteCode(GetSingleCodeFormat_Right);
                break;
            case 2911:  // 后二复式
                buyType = BuyType.B208;
                action = new GetAnteCode(GetManyCodeFormat_Right2);
                break;
            case 2912:  // 前一单式
                buyType = BuyType.B201;
                action = new GetAnteCode(GetSingleCodeFormat_Left);
                break;
            case 2913:  // 前一复式
                buyType = BuyType.B208;
                action = new GetAnteCode(GetManyCodeFormat_Left1);
                break;
            case 2914:  // 后一单式
                buyType = BuyType.B201;
                action = new GetAnteCode(GetSingleCodeFormat_Right);
                break;
            case 2915:  // 后一复式
                buyType = BuyType.B208;
                action = new GetAnteCode(GetManyCodeFormat_Right1);
                break;
            default:
                throw new ArgumentOutOfRangeException("玩法类型超出范围:" + playTypeValue);
        }

        anteCodes = new List<string>();
        foreach (string code in numbers.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries))
        {
            string anteCode = action(code);
            anteCodes.Add(anteCode);
        }
    }
Пример #2
0
    private void GetAnteCodes(int playTypeValue, string numbers, out BuyType buyType, out List <string> anteCodes)
    {
        GetAnteCode action;

        switch (playTypeValue)
        {
        case 2901:      // 直选单式
            buyType = BuyType.B201;
            action  = new GetAnteCode(GetSingleCodeFormat);
            break;

        case 2902:      // 直选复式
            buyType = BuyType.B208;
            action  = new GetAnteCode(GetManyCodeFormat);
            break;

        case 2903:      // 组选单式
            buyType = BuyType.B202;
            action  = new GetAnteCode(GetSingleCodeFormat);
            break;

        //case 2904:  // 组选6
        //    buyType = BuyType.B230;
        //    action = new GetAnteCode(GetSingleCodeFormat);
        //    break;
        //case 2905:  // 组选3
        //    buyType = BuyType.B230;
        //    action = new GetAnteCode(GetSingleCodeFormat);
        //    break;
        case 2908:      // 前二单式
            buyType = BuyType.B201;
            action  = new GetAnteCode(GetSingleCodeFormat_Left);
            break;

        case 2909:      // 前二复式
            buyType = BuyType.B208;
            action  = new GetAnteCode(GetManyCodeFormat_Left2);
            break;

        case 2910:      // 后二单式
            buyType = BuyType.B201;
            action  = new GetAnteCode(GetSingleCodeFormat_Right);
            break;

        case 2911:      // 后二复式
            buyType = BuyType.B208;
            action  = new GetAnteCode(GetManyCodeFormat_Right2);
            break;

        case 2912:      // 前一单式
            buyType = BuyType.B201;
            action  = new GetAnteCode(GetSingleCodeFormat_Left);
            break;

        case 2913:      // 前一复式
            buyType = BuyType.B208;
            action  = new GetAnteCode(GetManyCodeFormat_Left1);
            break;

        case 2914:      // 后一单式
            buyType = BuyType.B201;
            action  = new GetAnteCode(GetSingleCodeFormat_Right);
            break;

        case 2915:      // 后一复式
            buyType = BuyType.B208;
            action  = new GetAnteCode(GetManyCodeFormat_Right1);
            break;

        default:
            throw new ArgumentOutOfRangeException("玩法类型超出范围:" + playTypeValue);
        }

        anteCodes = new List <string>();
        foreach (string code in numbers.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries))
        {
            string anteCode = action(code);
            anteCodes.Add(anteCode);
        }
    }