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); }
public override void Eat(SnakeBody snake) { _adaptee.AddSpeed(snake, 5); _adaptee.AddLength(snake); _adaptee.ChangeColor(snake, "Teal"); }
public abstract void Eat(SnakeBody snake);
public SnakeBody ChangeColor(SnakeBody snake, string color) { snake.BodyColor = color; return(snake); }
public SnakeBody AddSpeed(SnakeBody snake, int speed) { snake.Speed += speed; return(snake); }