Browse Source

Change variable name style to reflect that it is a constant

Signed-off-by: Chris Cromer <chris@cromer.cl>
master
Chris Cromer 2 years ago
parent
commit
b4213e81c5
  1. 2
      src/main/java/cl/cromer/azaraka/Constants.java
  2. 2
      src/main/java/cl/cromer/azaraka/ai/PlayerAI.java

2
src/main/java/cl/cromer/azaraka/Constants.java

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

2
src/main/java/cl/cromer/azaraka/ai/PlayerAI.java

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

Loading…
Cancel
Save