예제 #1
0
        public Path PathWithNewCoordsAndDirection(Coords newCoords, Direction direction, int maxDirectionChanges)
        {
            var isActive = PathUtils.IsActiveWithNewCoords(this, newCoords, direction, maxDirectionChanges);
            var newNumDirectionChanges = NumDirectionChanges + (direction != Direction ? 1 : 0);

            return(new Path(CoordsList.Concat(new[] { newCoords }).ToArray(), direction, newNumDirectionChanges, isActive));
        }
예제 #2
0
 public Path PathWithEndCoords(Coords endCoords)
 {
     return(new Path(CoordsList.Concat(new[] { endCoords }).ToArray(), Direction, NumDirectionChanges, true));
 }