Exemple #1
0
        public SnakeBody AddLength(SnakeBody snake)
        {
            BodyPart lastPart = snake.BodyParts.Last();
            BodyPart newPart  = new BodyPart(lastPart.X, lastPart.Y, snake.BodyColor);

            snake.BodyParts.Add(newPart);
            return(snake);
        }
Exemple #2
0
 public override void Eat(SnakeBody snake)
 {
     _adaptee.AddSpeed(snake, 5);
     _adaptee.AddLength(snake);
     _adaptee.ChangeColor(snake, "Teal");
 }
Exemple #3
0
 public abstract void Eat(SnakeBody snake);
Exemple #4
0
 public SnakeBody ChangeColor(SnakeBody snake, string color)
 {
     snake.BodyColor = color;
     return(snake);
 }
Exemple #5
0
 public SnakeBody AddSpeed(SnakeBody snake, int speed)
 {
     snake.Speed += speed;
     return(snake);
 }