コード例 #1
0
ファイル: Partija.cs プロジェクト: demir6693/Domineering
        public List <List <Plocica> > Odigraj_V_prvi(List <Plocica> ll)
        {
            List <List <Plocica> > ll_vh = new List <List <Plocica> >();
            List <Plocica>         nd    = new List <Plocica>();
            Plocica p = new Plocica();

            for (int i = 0; i < ll.Count; i++)
            {
                if (i < _n * _n - _n)
                {
                    if (ll[i].igrac.Equals("0") && ll[i + _n].igrac.Equals("0"))
                    {
                        nd = new List <Plocica>();
                        for (int l = 0; l < ll.Count; l++)
                        {
                            p       = new Plocica();
                            p.igrac = ll[l].igrac;
                            p.x     = ll[l].x;
                            p.y     = ll[l].y;

                            nd.Add(p);
                        }

                        nd[i].igrac      = "V";
                        nd[i + _n].igrac = "V";

                        ll_vh.Add(nd);
                    }
                }
            }

            return(ll_vh);
        }
コード例 #2
0
        public void Trenutno_stanje()
        {
            List <Plocica> tabela_stanja = new List <Plocica>();

            for (int i = 0; i < n_pom; i++)
            {
                for (int j = 0; j < n_pom; j++)
                {
                    Plocica pl = new Plocica();

                    string index = (i + "," + j).ToString();
                    pl.igrac = this.Controls[index].Text;
                    pl.x     = int.Parse(index[0].ToString());
                    pl.y     = int.Parse(index[2].ToString());

                    tabela_stanja.Add(pl);
                }
            }
            trenutno_stanje = tabela_stanja;


            Partija prt = new Partija(trenutno_stanje, n_pom);
        }
コード例 #3
0
ファイル: Partija.cs プロジェクト: demir6693/Domineering
        public List <List <Plocica> > Odigraj_H(List <List <Plocica> > ll_vh)
        {
            List <List <Plocica> > ll_vh1 = new List <List <Plocica> >();
            List <Plocica>         nd     = new List <Plocica>();
            Plocica p = new Plocica();


            for (int i = 0; i < ll_vh.Count; i++)
            {
                for (int j = 0; j < ll_vh[i].Count; j++)
                {
                    if (j < ll_vh[i].Count - 1)
                    {
                        if (ll_vh[i][j].igrac.Equals("0") && ll_vh[i][j + 1].igrac.Equals("0") && ll_vh[i][j].x == ll_vh[i][j + 1].x)
                        {
                            nd = new List <Plocica>();
                            for (int l = 0; l < ll_vh[i].Count; l++)
                            {
                                p       = new Plocica();
                                p.igrac = ll_vh[i][l].igrac;
                                p.x     = ll_vh[i][l].x;
                                p.y     = ll_vh[i][l].y;

                                nd.Add(p);
                            }

                            nd[j].igrac     = "H";
                            nd[j + 1].igrac = "H";

                            ll_vh1.Add(nd);
                        }
                    }
                }
            }

            return(ll_vh1);
        }