示例#1
0
文件: Matrix.cs 项目: Longzsolt/Agar
        public bool eat()
        {
            Gombok gombi = new Gombok();

            gombi = GombList.ElementAt(0);
            foreach (var gombj in GombList)
            {
                if (gombj != gombi)
                {
                    Gombok gomby = new Gombok();
                    gomby    = gombj;
                    collgomb = gomby;
                    pozicio  = GombList.IndexOf(gomby);
                    if (gomby.getX() >= gombi.getX() && gomby.getX() + gomby.getSize() <= gombi.getX() + gombi.getSize())
                    {
                        if (gomby.getY() >= gombi.getY() && gomby.getY() + gomby.getSize() <= gombi.getY() + gombi.getSize())
                        {
                            if (gombi.getSize() < gomby.getSize())
                            {
                                return(false);
                            }
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
示例#2
0
文件: Matrix.cs 项目: Longzsolt/Agar
        public bool eat()
        {
            Gombok gombi = new Gombok();
            gombi = GombList.ElementAt(0);
            foreach (var gombj in GombList)
            {
                if (gombj != gombi)
                {
                    Gombok gomby = new Gombok();
                    gomby = gombj;
                    collgomb = gomby;
                    pozicio = GombList.IndexOf(gomby);
                    if (gomby.getX() >= gombi.getX() && gomby.getX() + gomby.getSize() <= gombi.getX() + gombi.getSize())
                    {

                        if (gomby.getY() >= gombi.getY() && gomby.getY() + gomby.getSize() <= gombi.getY() + gombi.getSize())
                        {
                            if (gombi.getSize() < gomby.getSize())
                            {
                                return false;
                            }
                            return true;
                        }

                    }

                }
            }
            return false;
        }
示例#3
0
文件: Matrix.cs 项目: Longzsolt/Agar
 public void Add(int i)
 {
     Gombok gomb = new Gombok();
     gomb.setSize(rnd.Next(4, GombList.ElementAt(0).getSize() + GombList.ElementAt(0).getSize() / 3));
     gomb.setX(rnd.Next(1, gomb.xMax - gomb.getSize() + 1));
     gomb.setY(rnd.Next(1, gomb.yMax - gomb.getSize() + 1));
     this.i++;
     GombList.Add(gomb);
 }
示例#4
0
文件: Matrix.cs 项目: Longzsolt/Agar
        public void Add(int i)
        {
            Gombok gomb = new Gombok();

            gomb.setSize(rnd.Next(4, GombList.ElementAt(0).getSize() + GombList.ElementAt(0).getSize() / 3));
            gomb.setX(rnd.Next(1, gomb.xMax - gomb.getSize() + 1));
            gomb.setY(rnd.Next(1, gomb.yMax - gomb.getSize() + 1));
            this.i++;
            GombList.Add(gomb);
        }