Пример #1
0
        public Point GetNextPoint()
        {
            Point head      = ListP.Last();
            Point NextPoint = new Point(head);

            NextPoint.Move(1, direction);
            return(NextPoint);
        }
Пример #2
0
        internal void Move()
        {
            Point tail = ListP.First();

            ListP.Remove(tail);
            Point head = GetNextPoint();

            ListP.Add(head);
            tail.Clear();
            head.Draw();
        }
Пример #3
0
        internal bool IsHitTail()
        {
            Point head = ListP.Last();

            for (int i = 0; i < ListP.Count - 2; i++)
            {
                if (head.IsHit(ListP[i]))
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #4
0
        internal bool Eat(Point food)
        {
            Point head = GetNextPoint();

            if (head.IsHit(food))
            {
                food.sym = head.sym;
                ListP.Add(food);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #5
0
 public Vector GetLastP()
 {
     return(ListP.Last());
 }