Пример #1
0
 private void AddOneRectOfBody()
 {
     SnakeObj.SnakeBody.Add(new SnakeBodyPart()
     {
         BasicRectangle = RectangleGenerator.Generate(RectangleTypes.SnakeBody),
         Index          = ++SnakeObj.MaxIndex,
         Location       = GetLocationForNewPart(SnakeObj.Direction)
     });
 }
Пример #2
0
 public void AddOneRectOfBody(SnakeDirection snakeDirection)
 {
     SnakeBodyParts.Add(new SnakeBodyPart()
     {
         BasicRectangle = RectangleGenerator.Generate(RectangleTypes.SnakeBody),
         Index          = ++MaxIndex,
         Location       = GetLocationForNewPart(snakeDirection)
     });
 }
Пример #3
0
        public static SnakeBodyPart GetDefaultBodyPart()
        {
            var bodyPart = new SnakeBodyPart()
            {
                BasicRectangle = RectangleGenerator.Generate(RectangleTypes.SnakeBody),
                Index          = 0,
                Location       = new PositionOnBoard(200, 200)
            };

            return(bodyPart);
        }