Change variable name style to reflect that it is a constant

Signed-off-by: Chris Cromer <chris@cromer.cl>
This commit is contained in:
Chris Cromer 2020-02-29 11:46:34 -03:00
parent 49789f6df3
commit b4213e81c5
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ public interface Constants {
/** /**
* The heuristic to use in the AI distance calculations * The heuristic to use in the AI distance calculations
*/ */
AIHeuristic aIHeuristic = AIHeuristic.MANHATTAN; AIHeuristic AI_HEURISTIC = AIHeuristic.MANHATTAN;
/** /**
* Which type of AI to use * Which type of AI to use
*/ */

View File

@ -74,7 +74,7 @@ public interface PlayerAI extends Runnable, Constants {
* @return Returns the distance between the states * @return Returns the distance between the states
*/ */
default double heuristic(State start, State goal) { default double heuristic(State start, State goal) {
switch (aIHeuristic) { switch (AI_HEURISTIC) {
case DIAGONAL: case DIAGONAL:
return Math.max(Math.abs(start.getX() - goal.getX()), Math.abs(start.getY() - goal.getY())); return Math.max(Math.abs(start.getX() - goal.getX()), Math.abs(start.getY() - goal.getY()));
case EUCLIDEAN: case EUCLIDEAN: