Change variable name style to reflect that it is a constant
Signed-off-by: Chris Cromer <chris@cromer.cl>
This commit is contained in:
parent
49789f6df3
commit
b4213e81c5
@ -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
|
||||||
*/
|
*/
|
||||||
|
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user