コード例 #1
0
        private UI.Grid ShowGrid(DataGridView DG, List <List <double> > M, SingleGame SG)
        {
            int n = SG.A.Count, m = SG.A[0].Count;

            UI.StrategiesGrid G = new UI.StrategiesGrid(DG, n, m);
            G.InitializeHeaders("Выигрыши", SG.FirstPlayer, SG.SecondPlayer, Database.G.S);
            DG.ReadOnly = true;
            G.InitializeGrid(M);
            return(G);
        }
コード例 #2
0
        private void CreateArrays(int pl1, int pl2)
        {
            SingleGame SG = G.FindGame(this, pl1, pl2);

            Ga             = new UI.StrategiesGrid(A, SG.A.Count, SG.A[0].Count);
            Ga.LimitedSize = true;
            Ga.InitializeHeaders("", SG.FirstPlayer, SG.SecondPlayer, Database.G.S);
            Ga.InitializeGrid(SG.A);

            Gb             = new UI.StrategiesGrid(B, SG.A.Count, SG.A[0].Count);
            Gb.LimitedSize = true;
            Gb.InitializeHeaders("", SG.FirstPlayer, SG.SecondPlayer, Database.G.S);
            Gb.InitializeGrid(SG.B);
        }
コード例 #3
0
        private void ThirdInterfaceSetup_GraphicalSolution(bool skipped)
        {
            Task2Panel.Hide();

            if (skipped)
            {
                List <int>    Drows    = new List <int>();
                List <int>    Dcolumns = new List <int>();
                List <string> Cheaders = new List <string>();
                List <string> Rheaders = new List <string>();
                SingleGame    D        = G.SingleGames[0].Dominate(Drows, Dcolumns);

                for (int i = 0; i < Drows.Count; i++)
                {
                    Rheaders.Add(A.Rows[Drows[i]].HeaderCell.Value.ToString());
                }
                for (int i = 0; i < Dcolumns.Count; i++)
                {
                    Cheaders.Add(A.Columns[Dcolumns[i]].HeaderCell.Value.ToString());
                }
                Ga             = new UI.StrategiesGrid(A, D.A.Count, D.A[0].Count);
                Gb             = new UI.StrategiesGrid(B, D.A.Count, D.A[0].Count);
                Ga.LimitedSize = true;
                Gb.LimitedSize = true;
                Ga.InitializeHeaders("", G.SingleGames[0].FirstPlayer, G.SingleGames[0].SecondPlayer, Database.G.S);
                Gb.InitializeHeaders("", G.SingleGames[0].FirstPlayer, G.SingleGames[0].SecondPlayer, Database.G.S);
                Ga.InitializeGrid(D.A);
                Gb.InitializeGrid(D.B);
                for (int i = 0; i < A.Rows.Count; i++)
                {
                    A.Rows[i].HeaderCell.Value = Rheaders[i];
                    B.Rows[i].HeaderCell.Value = Rheaders[i];
                }
                for (int j = 0; j < A.ColumnCount; j++)
                {
                    A.Columns[j].HeaderCell.Value = Cheaders[j];
                    B.Columns[j].HeaderCell.Value = Cheaders[j];
                }
            }

            if ((A.Rows.Count == 2) && (A.Columns.Count == 2))
            {
                Graphical2x2SolutionPanel.Show();

                UI.ControlsAligner gpanel = new UI.ControlsAligner(MatrixesPanel);
                gpanel.AddElement(A);
                gpanel.AddElement(B, false);
                gpanel.Align();

                UI.ControlsAligner form = new UI.ControlsAligner(this);
                form.AddElement(MatrixesPanel);
                form.AddElement(Graphical2x2SolutionPanel);
                form.AddElement(SkipBTN, true, "Left");
                form.AddElement(FinishBTN, false, "Right");
                form.Align();
            }
            else
            {
                CGStudentProgress.NewSection();
                FourthInterfaceSetup_PayoffDistributionAndSufficiency();
            }
        }