Merge branch '2.6.x' into 2.7.x

Closes gh-31525
This commit is contained in:
Andy Wilkinson
2022-06-24 13:05:06 +01:00
29 changed files with 411 additions and 410 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,18 +35,18 @@ public class Location {
public Location getAdjacentLocation(Direction direction) {
switch (direction) {
case NORTH:
return new Location(this.x, this.y - SnakeUtils.GRID_SIZE);
case SOUTH:
return new Location(this.x, this.y + SnakeUtils.GRID_SIZE);
case EAST:
return new Location(this.x + SnakeUtils.GRID_SIZE, this.y);
case WEST:
return new Location(this.x - SnakeUtils.GRID_SIZE, this.y);
case NONE:
// fall through
default:
return this;
case NORTH:
return new Location(this.x, this.y - SnakeUtils.GRID_SIZE);
case SOUTH:
return new Location(this.x, this.y + SnakeUtils.GRID_SIZE);
case EAST:
return new Location(this.x + SnakeUtils.GRID_SIZE, this.y);
case WEST:
return new Location(this.x - SnakeUtils.GRID_SIZE, this.y);
case NONE:
// fall through
default:
return this;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,18 +35,18 @@ public class Location {
public Location getAdjacentLocation(Direction direction) {
switch (direction) {
case NORTH:
return new Location(this.x, this.y - SnakeUtils.GRID_SIZE);
case SOUTH:
return new Location(this.x, this.y + SnakeUtils.GRID_SIZE);
case EAST:
return new Location(this.x + SnakeUtils.GRID_SIZE, this.y);
case WEST:
return new Location(this.x - SnakeUtils.GRID_SIZE, this.y);
case NONE:
// fall through
default:
return this;
case NORTH:
return new Location(this.x, this.y - SnakeUtils.GRID_SIZE);
case SOUTH:
return new Location(this.x, this.y + SnakeUtils.GRID_SIZE);
case EAST:
return new Location(this.x + SnakeUtils.GRID_SIZE, this.y);
case WEST:
return new Location(this.x - SnakeUtils.GRID_SIZE, this.y);
case NONE:
// fall through
default:
return this;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,18 +35,18 @@ public class Location {
public Location getAdjacentLocation(Direction direction) {
switch (direction) {
case NORTH:
return new Location(this.x, this.y - SnakeUtils.GRID_SIZE);
case SOUTH:
return new Location(this.x, this.y + SnakeUtils.GRID_SIZE);
case EAST:
return new Location(this.x + SnakeUtils.GRID_SIZE, this.y);
case WEST:
return new Location(this.x - SnakeUtils.GRID_SIZE, this.y);
case NONE:
// fall through
default:
return this;
case NORTH:
return new Location(this.x, this.y - SnakeUtils.GRID_SIZE);
case SOUTH:
return new Location(this.x, this.y + SnakeUtils.GRID_SIZE);
case EAST:
return new Location(this.x + SnakeUtils.GRID_SIZE, this.y);
case WEST:
return new Location(this.x - SnakeUtils.GRID_SIZE, this.y);
case NONE:
// fall through
default:
return this;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,18 +35,18 @@ public class Location {
public Location getAdjacentLocation(Direction direction) {
switch (direction) {
case NORTH:
return new Location(this.x, this.y - SnakeUtils.GRID_SIZE);
case SOUTH:
return new Location(this.x, this.y + SnakeUtils.GRID_SIZE);
case EAST:
return new Location(this.x + SnakeUtils.GRID_SIZE, this.y);
case WEST:
return new Location(this.x - SnakeUtils.GRID_SIZE, this.y);
case NONE:
// fall through
default:
return this;
case NORTH:
return new Location(this.x, this.y - SnakeUtils.GRID_SIZE);
case SOUTH:
return new Location(this.x, this.y + SnakeUtils.GRID_SIZE);
case EAST:
return new Location(this.x + SnakeUtils.GRID_SIZE, this.y);
case WEST:
return new Location(this.x - SnakeUtils.GRID_SIZE, this.y);
case NONE:
// fall through
default:
return this;
}
}