Пример #1
0
        void LOAD_GAME_SETTINGS___4_SimpleIMP()
        {
            isRobber = false;
            isSplit = false;
            canbeNoContract = true;

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DB !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            DB_Deals_TableName = "Deals_Sport";
            DB_Deals_ColumnsNames.Add(1, "CardsDistribution");
            DB_Deals_ColumnsNames.Add(3, "Pair");
            DB_Deals_ColumnsNames.Add(4, "Contract");
            DB_Deals_ColumnsNames.Add(5, "Result");

            columnsDataClasses = new ArrayOfTypes();
            columnsDataClasses.Add(typeof(IntData));
            columnsDataClasses.Add(typeof(CardsDistribution));
            columnsDataClasses.Add(typeof(ZoneSwitcher));
            columnsDataClasses.Add(typeof(PairSwitcher));
            columnsDataClasses.Add(typeof(Contract));
            columnsDataClasses.Add(typeof(Result));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(QuarterSwitcher));

            ID_NAMES.Add(0, "NO");
            ID_NAMES.Add(1, "DISTRIBUTION");
            ID_NAMES.Add(2, "ZONE");
            ID_NAMES.Add(3, "PAIR");
            ID_NAMES.Add(4, "CONTRACT");
            ID_NAMES.Add(5, "RESULT");
            ID_NAMES.Add(6, "SCORE");
            ID_NAMES.Add(7, "IMP");
            ID_NAMES.Add(8, "DEALER");

            REFLECT_Functions.Add(3, new FuncInfo[] { new FuncInfo("NoPairIfNoContract", new string[] { "PAIR", "CONTRACT" }) });
            REFLECT_Depends.Add(3, new int[] { 3, 4 });
            REFLECT_Functions.Add(0, new FuncInfo[] { new FuncInfo("IntData_Equal", new string[] { "NO", "MDEAL_NO" }) });
            REFLECT_Constructors.Add(0, new string[] { "true" });
            REFLECT_Depends.Add(0, new int[] { -1 });
            REFLECT_Functions.Add(2, new FuncInfo[] { new FuncInfo("DefineSportZone", new string[] { "ZONE", "LINE_NO__REAL", "MATCH_NO__REAL", "MDEAL_NO", GameSettings_3Sports_ZoneSwims.ToString() }) });
            REFLECT_Depends.Add(2, new int[] { -1 });
            REFLECT_Functions.Add(5, new FuncInfo[] { new FuncInfo("CorrectResultAccordingToContract", new string[] { "RESULT", "CONTRACT", "0" }) });
            REFLECT_Depends.Add(5, new int[] { 4 });
            REFLECT_Constructors.Add(5, new string[] { "CONTRACT" });
            REFLECT_Functions.Add(6, new FuncInfo[] { new FuncInfo("SportScore", new string[] { "SCORE", "PAIR", "ZONE", "CONTRACT", "RESULT" }) });
            REFLECT_Depends.Add(6, new int[] { 2, 3, 4, 5 });
            REFLECT_Functions.Add(7, new FuncInfo[] { new FuncInfo("ConvertToIMPs", new string[] { "IMP", "SCORE" }) });
            REFLECT_Depends.Add(7, new int[] { 6 });
            REFLECT_Functions.Add(8, new FuncInfo[] { new FuncInfo("DefineSportDealer", new string[] { "DEALER", "LINE_NO__REAL", "MATCH_NO__REAL", "MDEAL_NO", "FIRST_DEALER", GameSettings_3Sports_ZoneSwims.ToString() }) });
            REFLECT_Depends.Add(8, new int[] { -1 });
            //new for match:
            REFLECT_Functions.Add((int)CONST.MATCH_TOTAL_SCORE, new FuncInfo[] { new FuncInfo("SetMatchScore", new string[] { "MATCH_TOTAL_SCORE", "MATCH_NO", "7" }), new FuncInfo("TotalScore_MatchMode", new string[] { "MATCH_TOTAL_SCORE", "MATCH_NO__REAL" }) });
            REFLECT_Depends.Add((int)CONST.MATCH_TOTAL_SCORE, new int[] { 7 });
            REFLECT_InsideFunctionsList.Add("SetMatchScore");
            REFLECT_InsideFunctionsList.Add("TotalScore_MatchMode");

            NotNecessaryValues.Add(new int[] { 1 });
            ContractColumns.Add(new int[] { 4 });
            NotNecessaryValues_NOCONTRACT.Add(new ArrayOfInt());
            NotNecessaryValues_NOCONTRACT[0].Add(new int[] { 3 });

            columnsControlsClasses = new ArrayOfTypes();
            columnsControlsClasses.Add(typeof(DealInfoControl));
            columnsControlsClasses.Add(typeof(ShowTextControl_Center));
            columnsControlsClasses.Add(typeof(ShowTextControl));
            columnsControlsClasses.Add(typeof(SwitcherControl_Orange_Center));
            columnsControlsClasses.Add(typeof(ContractSelectControl));
            columnsControlsClasses.Add(typeof(ResultSelectControl));
            columnsControlsClasses.Add(typeof(ShowSimpleScore));
            columnsControlsClasses.Add(typeof(ShowSimpleScore));

            arrHeadersNames = new ArrayOfString();
            arrHeadersNames.Add("#");
            arrHeadersNames.Add("Сда-\nющий");
            arrHeadersNames.Add("Зона");
            arrHeadersNames.Add("Па\nра");
            arrHeadersNames.Add("Контракт");
            arrHeadersNames.Add("Рез-т");
            arrHeadersNames.Add("Очки");
            arrHeadersNames.Add("IMP");

            arrHeadersNames_FULL = new ArrayOfString();
            arrHeadersNames_FULL.Add("#");
            arrHeadersNames_FULL.Add("Сдающий");
            arrHeadersNames_FULL.Add("Зона");
            arrHeadersNames_FULL.Add("Пара");
            arrHeadersNames_FULL.Add("Контракт");
            arrHeadersNames_FULL.Add("Рез-т");
            arrHeadersNames_FULL.Add("Очки");
            arrHeadersNames_FULL.Add("IMP");

            arrHeadersWidths = new ArrayOfInt();
            arrHeadersWidths.Add(new int[] { 22+8, 42+3, 55+14, 28+14, 71+14, 47+14, 47+14, 30+14 });

            CoVa_Dependences = new ArrayOfArrayOfInt();
            for (int i = 0; i < arrHeadersNames.Count; i++)
                CoVa_Dependences.Add(new ArrayOfInt());
            CoVa_Dependences[0].Add(new int[] { 0, 1 });
            CoVa_Dependences[1].Add(8);
            CoVa_Dependences[2].Add(2);
            CoVa_Dependences[3].Add(3);
            CoVa_Dependences[4].Add(4);
            CoVa_Dependences[5].Add(5);
            CoVa_Dependences[6].Add(new int[] { 6 });  //относительно заданной пары
            CoVa_Dependences[7].Add(new int[] { 7 });  //относительно заданной пары
        }
Пример #2
0
        void LOAD_GAME_SETTINGS___2_Sport()
        {
            isRobber = false;
            isSplit = true;
            canbeNoContract = true;

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DB !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            DB_Deals_TableName = "Deals_Double";
            DB_Deals_ColumnsNames.Add(1, "CardsDistribution");
            DB_Deals_ColumnsNames.Add(5, "Pair1");
            DB_Deals_ColumnsNames.Add(6, "Contract1");
            DB_Deals_ColumnsNames.Add(7, "Result1");
            DB_Deals_ColumnsNames.Add(9, "Pair2");
            DB_Deals_ColumnsNames.Add(10, "Contract2");
            DB_Deals_ColumnsNames.Add(11, "Result2");

            columnsDataClasses = new ArrayOfTypes();

            columnsDataClasses.Add(typeof(IntData));
            columnsDataClasses.Add(typeof(CardsDistribution));
            columnsDataClasses.Add(typeof(IntData));
            columnsDataClasses.Add(typeof(IntData));
            columnsDataClasses.Add(typeof(ZoneSwitcher));
            columnsDataClasses.Add(typeof(PairSwitcher));
            columnsDataClasses.Add(typeof(Contract));
            columnsDataClasses.Add(typeof(Result));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(PairSwitcher));
            columnsDataClasses.Add(typeof(Contract));
            columnsDataClasses.Add(typeof(Result));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(QuarterSwitcher));

            SUBDEALS = new ArrayOfArrayOfInt();
            SUBDEALS.Add(new ArrayOfInt());
            SUBDEALS[0].Add(new int[] { 2, 5, 6, 7, 8 });
            SUBDEALS.Add(new ArrayOfInt());
            SUBDEALS[1].Add(new int[] { 3, 9, 10, 11, 12 });

            ID_NAMES.Add(0, "NO");
            ID_NAMES.Add(1, "DISTRIBUTION");
            ID_NAMES.Add(2, "SUBNO1");
            ID_NAMES.Add(3, "SUBNO2");
            ID_NAMES.Add(4, "ZONE");
            ID_NAMES.Add(5, "PAIR1");
            ID_NAMES.Add(6, "CONTRACT1");
            ID_NAMES.Add(7, "RESULT1");
            ID_NAMES.Add(8, "SCORE1");
            ID_NAMES.Add(9, "PAIR2");
            ID_NAMES.Add(10, "CONTRACT2");
            ID_NAMES.Add(11, "RESULT2");
            ID_NAMES.Add(12, "SCORE2");
            ID_NAMES.Add(13, "DIFF");
            ID_NAMES.Add(14, "IMP");
            ID_NAMES.Add(15, "DEALER");

            REFLECT_Functions.Add(5, new FuncInfo[] { new FuncInfo("NoPairIfNoContract", new string[] { "PAIR1", "CONTRACT1" }) });
            REFLECT_Depends.Add(5, new int[] { 5, 6 });
            REFLECT_Functions.Add(9, new FuncInfo[] { new FuncInfo("NoPairIfNoContract", new string[] { "PAIR2", "CONTRACT2" }) });
            REFLECT_Depends.Add(9, new int[] { 9, 10 });
            REFLECT_Functions.Add(0, new FuncInfo[] { new FuncInfo("IntData_Equal", new string[] { "NO", "MDEAL_NO" }) });
            REFLECT_Constructors.Add(0, new string[] { "true" });
            REFLECT_Depends.Add(0, new int[] { -1 });
            REFLECT_Functions.Add(2, new FuncInfo[] { new FuncInfo("IntData_Equal", new string[] { "SUBNO1", "0" }) });
            REFLECT_Constructors.Add(2, new string[] { "true" });
            REFLECT_Depends.Add(2, new int[] { -1 });
            REFLECT_Functions.Add(3, new FuncInfo[] { new FuncInfo("IntData_Equal", new string[] { "SUBNO2", "1" }) });
            REFLECT_Constructors.Add(3, new string[] { "true" });
            REFLECT_Depends.Add(3, new int[] { -2 });
            REFLECT_Functions.Add(4, new FuncInfo[] { new FuncInfo("DefineSportZone", new string[] { "ZONE", "LINE_NO__REAL", "MATCH_NO__REAL", "MDEAL_NO", GameSettings_3Sports_ZoneSwims.ToString() }) });
            REFLECT_Depends.Add(4, new int[] { -1 });
            REFLECT_Functions.Add(7, new FuncInfo[] { new FuncInfo("CorrectResultAccordingToContract", new string[] { "RESULT1", "CONTRACT1", "0" }) });
            REFLECT_Depends.Add(7, new int[] { 6 });
            REFLECT_Constructors.Add(7, new string[] { "CONTRACT1" });
            REFLECT_Functions.Add(8, new FuncInfo[] { new FuncInfo("SportScore", new string[] { "SCORE1", "PAIR1", "ZONE", "CONTRACT1", "RESULT1" }) });
            REFLECT_Depends.Add(8, new int[] { 4, 5, 6, 7 });
            REFLECT_Functions.Add(11, new FuncInfo[] { new FuncInfo("CorrectResultAccordingToContract", new string[] { "RESULT2", "CONTRACT2", "0" }) });
            REFLECT_Depends.Add(11, new int[] { 10 });
            REFLECT_Constructors.Add(11, new string[] { "CONTRACT2" });
            REFLECT_Functions.Add(12, new FuncInfo[] { new FuncInfo("SportScoreInvert", new string[] { "SCORE2", "PAIR2", "ZONE", "CONTRACT2", "RESULT2" }) });
            REFLECT_Depends.Add(12, new int[] { 4, 9, 10, 11 });
            REFLECT_Functions.Add(13, new FuncInfo[] { new FuncInfo("ScoreSumm", new string[] { "DIFF", "SCORE1", "SCORE2" }) });
            REFLECT_Depends.Add(13, new int[] { 8, 12 });
            REFLECT_Functions.Add(14, new FuncInfo[] { new FuncInfo("ConvertToIMPs", new string[] { "IMP", "DIFF" }) });
            REFLECT_Depends.Add(14, new int[] { 13 });
            REFLECT_Functions.Add(15, new FuncInfo[] { new FuncInfo("DefineSportDealer", new string[] { "DEALER", "LINE_NO__REAL", "MATCH_NO__REAL", "MDEAL_NO", "FIRST_DEALER", GameSettings_3Sports_ZoneSwims.ToString() }) });
            REFLECT_Depends.Add(15, new int[] { -1 });

            //new for match:
            REFLECT_Functions.Add((int)CONST.MATCH_TOTAL_SCORE, new FuncInfo[] { new FuncInfo("SetMatchScore", new string[] { "MATCH_TOTAL_SCORE", "MATCH_NO", "14" }), new FuncInfo("TotalScore_MatchMode", new string[] { "MATCH_TOTAL_SCORE", "MATCH_NO__REAL" }) });
            REFLECT_Depends.Add((int)CONST.MATCH_TOTAL_SCORE, new int[] { 14 });
            REFLECT_InsideFunctionsList.Add("SetMatchScore");
            REFLECT_InsideFunctionsList.Add("TotalScore_MatchMode");

            NotNecessaryValues.Add(new int[] { 1, 13, 14 });
            ContractColumns.Add(new int[] { 6, 10 });
            NotNecessaryValues_NOCONTRACT.Add(new ArrayOfInt());
            NotNecessaryValues_NOCONTRACT.Add(new ArrayOfInt());
            NotNecessaryValues_NOCONTRACT[0].Add(new int[] { 5 });
            NotNecessaryValues_NOCONTRACT[1].Add(new int[] { 9 });

            columnsControlsClasses = new ArrayOfTypes();
            columnsControlsClasses.Add(typeof(DealInfoControl_split));
            columnsControlsClasses.Add(typeof(ShowTextControl_Center));
            columnsControlsClasses.Add(typeof(ShowTextControl_Center));
            columnsControlsClasses.Add(typeof(ShowTextControl));
            columnsControlsClasses.Add(typeof(SwitcherControl_Orange_Center));
            columnsControlsClasses.Add(typeof(ContractSelectControl));
            columnsControlsClasses.Add(typeof(ResultSelectControl));
            columnsControlsClasses.Add(typeof(ShowSimpleScore));
            columnsControlsClasses.Add(typeof(ShowSimpleScore));
            columnsControlsClasses.Add(typeof(ShowSimpleScore));

            arrHeadersNames = new ArrayOfString();
            arrHeadersNames.Add("#");
            arrHeadersNames.Add("Ст\nол");
            arrHeadersNames.Add("Сда\nющ.");
            arrHeadersNames.Add("Зона");
            arrHeadersNames.Add("Па\nра");
            arrHeadersNames.Add("Контракт");
            arrHeadersNames.Add("Рез-т");
            arrHeadersNames.Add("Очки");
            arrHeadersNames.Add("Раз-\nница");
            arrHeadersNames.Add("IMP");

            arrHeadersNames_FULL = new ArrayOfString();
            arrHeadersNames_FULL.Add("#");
            arrHeadersNames_FULL.Add("Стол");
            arrHeadersNames_FULL.Add("Сдающий");
            arrHeadersNames_FULL.Add("Зона");
            arrHeadersNames_FULL.Add("Пара");
            arrHeadersNames_FULL.Add("Контракт");
            arrHeadersNames_FULL.Add("Рез-т");
            arrHeadersNames_FULL.Add("Очки");
            arrHeadersNames_FULL.Add("Разница");
            arrHeadersNames_FULL.Add("IMP");

            // Какие контролы разделены?
            SUBDEALS_CONTROLS_ISSPLIT = new ArrayList();
            SUBDEALS_CONTROLS_ISSPLIT.Add(false);
            SUBDEALS_CONTROLS_ISSPLIT.Add(true);
            SUBDEALS_CONTROLS_ISSPLIT.Add(false);
            SUBDEALS_CONTROLS_ISSPLIT.Add(false);
            SUBDEALS_CONTROLS_ISSPLIT.Add(true);
            SUBDEALS_CONTROLS_ISSPLIT.Add(true);
            SUBDEALS_CONTROLS_ISSPLIT.Add(true);
            SUBDEALS_CONTROLS_ISSPLIT.Add(true);
            SUBDEALS_CONTROLS_ISSPLIT.Add(false);
            SUBDEALS_CONTROLS_ISSPLIT.Add(false);

            arrHeadersWidths = new ArrayOfInt();
            arrHeadersWidths.Add(new int[] { 22+4, 22, 33, 51+7, 26+7, 69+6, 45+6, 45+7, 45+7, 28+6 });

            CoVa_Dependences = new ArrayOfArrayOfInt();
            for (int i = 0; i < arrHeadersNames.Count; i++)
                CoVa_Dependences.Add(new ArrayOfInt());
            CoVa_Dependences[0].Add(new int[] { 0, 1 });
            CoVa_Dependences[2].Add(15);
            CoVa_Dependences[3].Add(4);
            CoVa_Dependences[8].Add(new int[] { 13 });  //относительно static
            CoVa_Dependences[9].Add(new int[] { 14 });  //относительно static

            CoVa_Dependences_SPLIT = new ArrayOfArrayOfInt();
            for (int i = 0; i < arrHeadersNames.Count; i++)
                CoVa_Dependences_SPLIT.Add(new ArrayOfInt());
            CoVa_Dependences_SPLIT[1].Add(new int[] { 2, 3 });
            CoVa_Dependences_SPLIT[4].Add(new int[] { 5, 9 });
            CoVa_Dependences_SPLIT[5].Add(new int[] { 6, 10 });
            CoVa_Dependences_SPLIT[6].Add(new int[] { 7, 11 });
            CoVa_Dependences_SPLIT[7].Add(new int[] { 8, 12 });   //относительно static (было 5,9,8,12)
        }
Пример #3
0
        void LOAD_GAME_SETTINGS___3_Compensat()
        {
            isRobber = false;
            isSplit = false;
            canbeNoContract = true;

            // ОПЦИИ
            GameSettings_Comp_Type = (BridgeGameScoring.TypeOfCompensation)(GameSettings_Options & 3); //2 bits
            GameSettings_Comp_10CardsIs2Fits = ((GameSettings_Options & 4) > 0); //3rd bit
            GameSettings_Comp_LessCompFor2Fits23PC = ((GameSettings_Options & 8) > 0); //4th bit

            // Скрыть ли сдающего в меню?
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
                hide_dealer_in_menu = true;
            else
                hide_dealer_in_menu = false;

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DB !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            DB_Deals_TableName = "Deals_Sport";
            DB_Deals_ColumnsNames.Add(1, "CardsDistribution");
            DB_Deals_ColumnsNames.Add(3, "Pair");
            DB_Deals_ColumnsNames.Add(4, "Contract");
            DB_Deals_ColumnsNames.Add(5, "Result");
            DB_Deals_ColumnsNames.Add(7, "Figures");
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                DB_Deals_ColumnsNames.Add(12, "Fits");
                DB_Deals_ColumnsNames.Add(13, "StrongestPair");
            }

            columnsDataClasses = new ArrayOfTypes();
            columnsDataClasses.Add(typeof(IntData));
            columnsDataClasses.Add(typeof(CardsDistribution));
            columnsDataClasses.Add(typeof(ZoneSwitcher));
            columnsDataClasses.Add(typeof(PairSwitcher));
            columnsDataClasses.Add(typeof(Contract));
            columnsDataClasses.Add(typeof(Result));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(IntData));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(QuarterSwitcher));
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                columnsDataClasses.Add(typeof(FitsSwitcher));
                columnsDataClasses.Add(typeof(BoolData));
            }

            ID_NAMES.Add(0, "NO");
            ID_NAMES.Add(1, "DISTRIBUTION");
            ID_NAMES.Add(2, "ZONE");
            ID_NAMES.Add(3, "PAIR");
            ID_NAMES.Add(4, "CONTRACT");
            ID_NAMES.Add(5, "RESULT");
            ID_NAMES.Add(6, "SCORE");
            ID_NAMES.Add(7, "FIG");
            ID_NAMES.Add(8, "COMPENS");
            ID_NAMES.Add(9, "DIFF");
            ID_NAMES.Add(10, "IMP");
            ID_NAMES.Add(11, "DEALER");
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                ID_NAMES.Add(12, "FITS");
                ID_NAMES.Add(13, "STRONGEST");
            }

            REFLECT_Functions.Add(3, new FuncInfo[] { new FuncInfo("NoPairIfNoContract", new string[] { "PAIR", "CONTRACT" }) });
            REFLECT_Depends.Add(3, new int[] { 3, 4 });
            REFLECT_Functions.Add(0, new FuncInfo[] { new FuncInfo("IntData_Equal", new string[] { "NO", "MDEAL_NO" }) });
            REFLECT_Constructors.Add(0, new string[] { "true" });
            REFLECT_Depends.Add(0, new int[] { -1 });
            REFLECT_Functions.Add(2, new FuncInfo[] { new FuncInfo("DefineSportZone", new string[] { "ZONE", "LINE_NO__REAL", "MATCH_NO__REAL", "MDEAL_NO", GameSettings_3Sports_ZoneSwims.ToString() }) });
            REFLECT_Depends.Add(2, new int[] { -1 });
            REFLECT_Functions.Add(5, new FuncInfo[] { new FuncInfo("CorrectResultAccordingToContract", new string[] { "RESULT", "CONTRACT", "0" }) });
            REFLECT_Depends.Add(5, new int[] { 4 });
            REFLECT_Constructors.Add(5, new string[] { "CONTRACT" });
            REFLECT_Functions.Add(6, new FuncInfo[] { new FuncInfo("SportScore", new string[] { "SCORE", "PAIR", "ZONE", "CONTRACT", "RESULT" }) });
            REFLECT_Depends.Add(6, new int[] { 2, 3, 4, 5 });

            //fig
            REFLECT_Functions.Add(7, new FuncInfo[] { new FuncInfo("FiguresPoints", new string[] { "FIG", "DISTRIBUTION", "TRUE", /*not use*/ "PAIR" }) });
            REFLECT_Depends.Add(7, new int[] { 7, 1 });
            REFLECT_Constructors.Add(7, new string[] { "true", "0", "true", "40" });

            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                // strongest
                REFLECT_Functions.Add(13, new FuncInfo[] { new FuncInfo("WhoIsStrongest20", new string[] { "STRONGEST", "FIG", "DISTRIBUTION", "LOADING_FROM_DB" }) });
                REFLECT_Depends.Add(13, new int[] { 1, 7 });

                //fits
                REFLECT_Functions.Add(12, new FuncInfo[] { new FuncInfo("FitsPoints", new string[] { "FITS", "DISTRIBUTION", (GameSettings_Comp_10CardsIs2Fits ? "TRUE" : "FALSE") }) });
                REFLECT_Depends.Add(12, new int[] { 12, 1 });
            }

            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                //comp with fits
                REFLECT_Functions.Add(8, new FuncInfo[] { new FuncInfo("GetCompensation_WithFits", new string[] { "COMPENS", "DISTRIBUTION", "FIG", "ZONE", "TRUE", /*not use*/"PAIR", /* ||||| */ "FITS", "STRONGEST", (GameSettings_Comp_10CardsIs2Fits ? "TRUE" : "FALSE"), (GameSettings_Comp_LessCompFor2Fits23PC ? "TRUE" : "FALSE") }) });
                REFLECT_Depends.Add(8, new int[] { 7, 2, 1, 12, 13 });
            }
            else
            {
                //comp
                REFLECT_Functions.Add(8, new FuncInfo[] { new FuncInfo("GetCompensation", new string[] { "COMPENS", "DISTRIBUTION", "FIG", "ZONE", "TRUE", /*not use*/"PAIR", ((int)GameSettings_Comp_Type).ToString() }) });
                REFLECT_Depends.Add(8, new int[] { 7, 2, 1 });
            }
            REFLECT_Functions.Add(9, new FuncInfo[] { new FuncInfo("ScoreSumm", new string[] { "DIFF", "SCORE", "COMPENS" }) });
            REFLECT_Depends.Add(9, new int[] { 6, 8 });
            REFLECT_Functions.Add(10, new FuncInfo[] { new FuncInfo("ConvertToIMPs", new string[] { "IMP", "DIFF" }) });
            REFLECT_Depends.Add(10, new int[] { 9 });
            REFLECT_Functions.Add(11, new FuncInfo[] { new FuncInfo("DefineSportDealer", new string[] { "DEALER", "LINE_NO__REAL", "MATCH_NO__REAL", "MDEAL_NO", "FIRST_DEALER", GameSettings_3Sports_ZoneSwims.ToString() }) });
            REFLECT_Depends.Add(11, new int[] { -1 });

            //new for match:
            REFLECT_Functions.Add((int)CONST.MATCH_TOTAL_SCORE, new FuncInfo[] { new FuncInfo("SetMatchScore", new string[] { "MATCH_TOTAL_SCORE", "MATCH_NO", "10" }), new FuncInfo("TotalScore_MatchMode", new string[] { "MATCH_TOTAL_SCORE", "MATCH_NO__REAL" }) });
            REFLECT_Depends.Add((int)CONST.MATCH_TOTAL_SCORE, new int[] { 10 });
            REFLECT_InsideFunctionsList.Add("SetMatchScore");
            REFLECT_InsideFunctionsList.Add("TotalScore_MatchMode");

            NotNecessaryValues.Add(new int[] { 1 });
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                NotNecessaryValues.Add(new int[] { 13 }); //!!!!!!!!!!! указать сильную сторону все-таки обязательно, если фигур=20 !!!!!!!!!!!!
            }
            ContractColumns.Add(new int[] { 4 });
            NotNecessaryValues_NOCONTRACT.Add(new ArrayOfInt());
            NotNecessaryValues_NOCONTRACT[0].Add(new int[] { 3 });

            columnsControlsClasses = new ArrayOfTypes();
            columnsControlsClasses.Add(typeof(DealInfoControl));
            if (!hide_dealer_in_menu)
            {
                columnsControlsClasses.Add(typeof(ShowTextControl_Center)); //1...
            }
            columnsControlsClasses.Add(typeof(ShowTextControl));
            columnsControlsClasses.Add(typeof(SwitcherControl_Orange));
            columnsControlsClasses.Add(typeof(ContractSelectControl));
            columnsControlsClasses.Add(typeof(ResultSelectControl));
            columnsControlsClasses.Add(typeof(ShowSimpleScore));
            columnsControlsClasses.Add(typeof(TextBoxInTable)); //6
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                columnsControlsClasses.Add(typeof(SwitcherControl_Orange)); //7
            }
            columnsControlsClasses.Add(typeof(ShowSimpleScore)); //7-8
            columnsControlsClasses.Add(typeof(ShowSimpleScore)); //8-9
            columnsControlsClasses.Add(typeof(ShowSimpleScore)); //9-10

            arrHeadersNames = new ArrayOfString();
            arrHeadersNames.Add("#");
            if (!hide_dealer_in_menu)
            {
                arrHeadersNames.Add("Сда\nющ.");
            }
            arrHeadersNames.Add("Зона");
            arrHeadersNames.Add("Па\nра");
            arrHeadersNames.Add("Контракт");
            arrHeadersNames.Add("Рез-т");
            arrHeadersNames.Add("Очки");
            arrHeadersNames.Add("Фи\nгур"); //6
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                arrHeadersNames.Add("Фи\nты"); //7
            }
            arrHeadersNames.Add("Комп."); //7-8
            arrHeadersNames.Add("Раз-\nница"); //8-9
            arrHeadersNames.Add("IMP"); //9-10

            arrHeadersNames_FULL = new ArrayOfString();
            arrHeadersNames_FULL.Add("#");
            if (!hide_dealer_in_menu)
            {
                arrHeadersNames_FULL.Add("Сдающий");
            }
            arrHeadersNames_FULL.Add("Зона");
            arrHeadersNames_FULL.Add("Пара");
            arrHeadersNames_FULL.Add("Контракт");
            arrHeadersNames_FULL.Add("Рез-т");
            arrHeadersNames_FULL.Add("Очки");
            arrHeadersNames_FULL.Add("Фигуры (NS)"); //6
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                arrHeadersNames_FULL.Add("Фиты"); //7
            }
            arrHeadersNames_FULL.Add("Компенсация"); //7-8
            arrHeadersNames_FULL.Add("Разница"); //8-9
            arrHeadersNames_FULL.Add("IMP"); //9-10

            arrHeadersWidths = new ArrayOfInt();
            arrHeadersWidths.Add(22);
            if (!hide_dealer_in_menu)
            {
                arrHeadersWidths.Add(33);
            }
            arrHeadersWidths.Add(new int[] { 51, 26, 69, 45, 45, 26 });
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
                arrHeadersWidths.Add(25);
            arrHeadersWidths.Add(new int[] { 45, 45, 28 });

            int hidden_dealer_offset = (!hide_dealer_in_menu) ? 1 : 0; //сдвиг индексов на 1 (после #), если сдающего все-таки показывать
            CoVa_Dependences = new ArrayOfArrayOfInt();
            for (int i = 0; i < arrHeadersNames.Count; i++)
                CoVa_Dependences.Add(new ArrayOfInt());
            if (hide_dealer_in_menu)
            {
                CoVa_Dependences[0].Add(new int[] { 0, 1, 11 });
            }
            else
            {
                CoVa_Dependences[0].Add(new int[] { 0, 1 });
                CoVa_Dependences[1].Add(11);
            }
            CoVa_Dependences[1 + hidden_dealer_offset].Add(2);
            CoVa_Dependences[2 + hidden_dealer_offset].Add(3);
            CoVa_Dependences[3 + hidden_dealer_offset].Add(4);
            CoVa_Dependences[4 + hidden_dealer_offset].Add(5);
            CoVa_Dependences[5 + hidden_dealer_offset].Add(new int[] { 6 });  //относительно static
            CoVa_Dependences[6 + hidden_dealer_offset].Add(7);
            if (GameSettings_Comp_Type == BridgeGameScoring.TypeOfCompensation.Europe)
            {
                CoVa_Dependences[7 + hidden_dealer_offset].Add(new int[] { 12 });  // относительно СИЛЬНОЙ пары, так что ПОХУЙ //
                CoVa_Dependences[8 + hidden_dealer_offset].Add(new int[] { 8 });  //относительно static
                CoVa_Dependences[9 + hidden_dealer_offset].Add(new int[] { 9 });  //относительно static
                CoVa_Dependences[10 + hidden_dealer_offset].Add(new int[] { 10 });  //относительно static
            }
            else
            {
                CoVa_Dependences[7 + hidden_dealer_offset].Add(new int[] { 8 });  //относительно static
                CoVa_Dependences[8 + hidden_dealer_offset].Add(new int[] { 9 });  //относительно static
                CoVa_Dependences[9 + hidden_dealer_offset].Add(new int[] { 10 });  //относительно static
            }
        }
Пример #4
0
        void LOAD_GAME_SETTINGS___1_Robber()
        {
            isRobber = true;
            isSplit = false;
            canbeNoContract = true;

            // ОПЦИИ
            GameSettings_Rob_BonusForOners = ((GameSettings_Options & 1) > 0);
            GameSettings_Rob_BonusForWholeRobber = ((GameSettings_Options & 2) > 0);

            //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DB !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            DB_Deals_TableName = "Deals_Rob";
            DB_Deals_ColumnsNames.Add(6, "CardsDistribution");
            DB_Deals_ColumnsNames.Add(1, "Pair");
            DB_Deals_ColumnsNames.Add(2, "Contract");
            DB_Deals_ColumnsNames.Add(3, "Result");
            if (GameSettings_Rob_BonusForOners)
                DB_Deals_ColumnsNames.Add(8, "Oners");

            columnsDataClasses = new ArrayOfTypes();
            columnsDataClasses.Add(typeof(ZoneSwitcher));
            columnsDataClasses.Add(typeof(PairSwitcher));
            columnsDataClasses.Add(typeof(Contract));
            columnsDataClasses.Add(typeof(Result));
            columnsDataClasses.Add(typeof(SimpleScore));
            columnsDataClasses.Add(typeof(IntData));
            columnsDataClasses.Add(typeof(CardsDistribution));
            columnsDataClasses.Add(typeof(QuarterSwitcher));
            if (GameSettings_Rob_BonusForOners)
                columnsDataClasses.Add(typeof(OnersSwitcher));

            ID_NAMES.Add(0, "ZONE");
            ID_NAMES.Add(1, "PAIR");
            ID_NAMES.Add(2, "CONTRACT");
            ID_NAMES.Add(3, "RESULT");
            ID_NAMES.Add(4, "RDEAL_LIGHTSCORE");
            ID_NAMES.Add(5, "NO");
            ID_NAMES.Add(6, "DISTRIBUTION");
            ID_NAMES.Add(7, "DEALER");
            if (GameSettings_Rob_BonusForOners)
                ID_NAMES.Add(8, "ONERS");

            REFLECT_Functions.Add(0, new FuncInfo[] { new FuncInfo("DefineRobberZone", new string[] { "ZONE", "ROBBER", "RDEAL_NO" }) });
            REFLECT_Depends.Add(0, new int[] { -1 });
            REFLECT_Functions.Add(1, new FuncInfo[] { new FuncInfo("NoPairIfNoContract", new string[] { "PAIR", "CONTRACT" }) });
            REFLECT_Depends.Add(1, new int[] { 1, 2 });
            REFLECT_Functions.Add(3, new FuncInfo[] { new FuncInfo("CorrectResultAccordingToContract", new string[] { "RESULT", "CONTRACT", "0" }) });
            REFLECT_Depends.Add(3, new int[] { 2 });
            REFLECT_Constructors.Add(3, new string[] { "CONTRACT" });
            if (GameSettings_Rob_BonusForOners)
            {
                REFLECT_Functions.Add((int)CONST.RDEAL_FULLSCORE, new FuncInfo[] { new FuncInfo("RobberScore", new string[] { "RDEAL_FULLSCORE", "PAIR", "ZONE", "CONTRACT", "RESULT", (GameSettings_Rob_BonusForWholeRobber ? "TRUE" : "FALSE"), "ROBBER", "RDEAL_NO", "ONERS" }) });
                REFLECT_Depends.Add((int)CONST.RDEAL_FULLSCORE, new int[] { 0, 1, 2, 3, 8 });
            }
            else
            {
                REFLECT_Functions.Add((int)CONST.RDEAL_FULLSCORE, new FuncInfo[] { new FuncInfo("RobberScore", new string[] { "RDEAL_FULLSCORE", "PAIR", "ZONE", "CONTRACT", "RESULT", (GameSettings_Rob_BonusForWholeRobber ? "TRUE" : "FALSE"), "ROBBER", "RDEAL_NO" }) });
                REFLECT_Depends.Add((int)CONST.RDEAL_FULLSCORE, new int[] { 0, 1, 2, 3 });
            }
            REFLECT_Functions.Add(4, new FuncInfo[] { new FuncInfo("RobberScoreLight", new string[] { "RDEAL_LIGHTSCORE", "RDEAL_FULLSCORE" }) });
            REFLECT_Depends.Add(4, new int[] { (int)CONST.RDEAL_FULLSCORE });
            REFLECT_Functions.Add(5, new FuncInfo[] { new FuncInfo("IntData_Equal", new string[] { "NO", "RDEAL_NO" }) });
            REFLECT_Constructors.Add(5, new string[] { "true" });
            REFLECT_Depends.Add(5, new int[] { -1 });
            REFLECT_Functions.Add((int)CONST.ROBBER, new FuncInfo[] { new FuncInfo("CleanUnnecessaryRDealsInRobber", new string[] { "ROBBER", "ROBBER_FIRSTLINE" }), new FuncInfo("InvalidateRobber", new string[] { "ROBBER" }) });
            REFLECT_Depends.Add((int)CONST.ROBBER, new int[] { (int)CONST.RDEAL_FULLSCORE });
            REFLECT_Recounts.Add((int)CONST.ROBBER, new int[] { 0, (int)CONST.RDEAL_FULLSCORE });
            REFLECT_Functions.Add((int)CONST.ROBBER_TOTAL_SCORE, new FuncInfo[] { new FuncInfo("SetRobberScore", new string[] { "ROBBER", "ROBBER_TOTAL_SCORE" }), new FuncInfo("TotalScore_RobberMode", new string[] { "ROBBER_TOTAL_SCORE", "ROBBER_NO__REAL" }) });
            REFLECT_Depends.Add((int)CONST.ROBBER_TOTAL_SCORE, new int[] { (int)CONST.ROBBER });
            REFLECT_InsideFunctionsList.Add("CleanUnnecessaryRDealsInRobber");
            REFLECT_InsideFunctionsList.Add("InvalidateRobber");
            REFLECT_InsideFunctionsList.Add("TotalScore_RobberMode");
            REFLECT_Functions.Add(7, new FuncInfo[] { new FuncInfo("DefineRobberDealer", new string[] { "DEALER", "LINE_NO__REAL", "ROBBER_NO__REAL", "RDEAL_NO", "FIRST_DEALER" }) });
            REFLECT_Depends.Add(7, new int[] { -1 });

            if (GameSettings_Rob_BonusForOners)
            {
                REFLECT_Functions.Add(8, new FuncInfo[] { new FuncInfo("GetOners", new string[] { "ONERS", "CONTRACT", "DISTRIBUTION" }) });
                REFLECT_Depends.Add(8, new int[] { 8, 2, 6 });
            }

            NotNecessaryValues.Add(6);
            ContractColumns.Add(new int[] { 2 });
            NotNecessaryValues_NOCONTRACT.Add(new ArrayOfInt());
            NotNecessaryValues_NOCONTRACT[0].Add(new int[] { 1 });
            if (GameSettings_Rob_BonusForOners)
                NotNecessaryValues_NOCONTRACT[0].Add(new int[] { 8 });

            columnsControlsClasses = new ArrayOfTypes();
            columnsControlsClasses.Add(typeof(DealInfoControl));
            columnsControlsClasses.Add(typeof(ShowTextControl_Center));
            columnsControlsClasses.Add(typeof(ShowTextControl));
            columnsControlsClasses.Add(typeof(SwitcherControl_Orange_Center));
            columnsControlsClasses.Add(typeof(ContractSelectControl));
            if (GameSettings_Rob_BonusForOners)
                columnsControlsClasses.Add(typeof(SwitcherControl_Orange));
            columnsControlsClasses.Add(typeof(ResultSelectControl));
            columnsControlsClasses.Add(typeof(ShowSimpleScore));

            arrHeadersNames = new ArrayOfString();
            arrHeadersNames.Add("#");
            arrHeadersNames.Add("Сда\nющ.");
            arrHeadersNames.Add("Зона");
            arrHeadersNames.Add("Па\nра");
            arrHeadersNames.Add("Контракт");
            if (GameSettings_Rob_BonusForOners)
                arrHeadersNames.Add("Онеры");
            arrHeadersNames.Add("Рез-т");
            arrHeadersNames.Add("Очки");

            arrHeadersNames_FULL = new ArrayOfString();
            arrHeadersNames_FULL.Add("#");
            arrHeadersNames_FULL.Add("Сдающий");
            arrHeadersNames_FULL.Add("Зона");
            arrHeadersNames_FULL.Add("Пара");
            arrHeadersNames_FULL.Add("Контракт");
            if (GameSettings_Rob_BonusForOners)
                arrHeadersNames_FULL.Add("Онеры");
            arrHeadersNames_FULL.Add("Рез-т");
            arrHeadersNames_FULL.Add("Очки");

            arrHeadersWidths = new ArrayOfInt();
            if (GameSettings_Rob_BonusForOners)
            {
                arrHeadersWidths.Add(new int[] { 22, 33, 51, 26, 69, /*oners*/51, 45, 45 });
            }
            else
            {
                arrHeadersWidths.Add(new int[] { 22+8, 33, 51+9, 26+9, 69+8, 45+9, 45+9 });
            }

            CoVa_Dependences = new ArrayOfArrayOfInt();
            for (int i = 0; i < arrHeadersNames.Count; i++)
                CoVa_Dependences.Add(new ArrayOfInt());
            CoVa_Dependences[0].Add(new int[] { 5, 6 });
            CoVa_Dependences[1].Add(7);
            CoVa_Dependences[2].Add(0);
            CoVa_Dependences[3].Add(1);
            CoVa_Dependences[4].Add(2);
            if (GameSettings_Rob_BonusForOners)
            {
                CoVa_Dependences[5].Add(8);
                CoVa_Dependences[6].Add(3);
                CoVa_Dependences[7].Add(new int[] { 4 }); //относительно static
            }
            else
            {
                CoVa_Dependences[5].Add(3);
                CoVa_Dependences[6].Add(new int[] { 4 }); //относительно static
            }
        }