public static Location[] AllOtherSnakePoints(this Snake.Snake[] snakes, Snake.Snake mySnake) { var ret = new List <Location>(); foreach (var snake in snakes.Where(s => s.Id != mySnake.Id)) { ret.AddRange(snake.Body); } return(ret.ToArray()); }
public static Location[] AllOtherLargerSnakeHeads(this Snake.Snake[] snakes, Snake.Snake mySnake) { var ret = new List <Location>(); foreach (var snake in snakes.Where(s => s.Id != mySnake.Id)) { if (mySnake.Body.Length <= snake.Body.Length) { var snakeHead = snake.Body.GetHead(); ret.Add(snakeHead); } } return(ret.ToArray()); }