Package cl.cromer.azaraka.ai
Class AI
- java.lang.Object
-
- cl.cromer.azaraka.ai.AI
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
EnemyAI
,PlayerAStarAI
,PlayerBreadthFirstAI
public class AI extends java.lang.Object implements java.lang.Runnable
AI algorithms extends this class
-
-
Constructor Summary
Constructors Constructor Description AI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDestination(State destination)
Add a destination to the list of destinationsprotected boolean
getActive()
Get the active state of the AIprotected java.util.logging.Logger
getLogger()
Get the logger being used by the AIvoid
removeKeyDestination(int x, int y)
Remove the picked up key from destinations if it is therevoid
run()
The AI should run in a loopvoid
setActive(boolean active)
Set the active state for the AI loopprotected void
setLogger(java.util.logging.Logger logger)
Set the logger that the AI should use
-
-
-
Method Detail
-
getActive
protected boolean getActive()
Get the active state of the AI- Returns:
- Returns true if the AI is active or false otherwise
-
setActive
public void setActive(boolean active)
Set the active state for the AI loop- Parameters:
active
- Set to true to have the run method loop run indefinitely or false to stop the loop
-
getLogger
protected java.util.logging.Logger getLogger()
Get the logger being used by the AI- Returns:
- Returns the logger
-
setLogger
protected void setLogger(java.util.logging.Logger logger)
Set the logger that the AI should use- Parameters:
logger
- The logger to use
-
addDestination
public void addDestination(State destination) throws AIException
Add a destination to the list of destinations- Parameters:
destination
- The destination- Throws:
AIException
- Thrown when the parent method is called directly
-
removeKeyDestination
public void removeKeyDestination(int x, int y) throws AIException
Remove the picked up key from destinations if it is there- Parameters:
x
- The x coordinate of the keyy
- The y coordinate of the key- Throws:
AIException
- Thrown when the parent method is called directly
-
run
public void run()
The AI should run in a loop- Specified by:
run
in interfacejava.lang.Runnable
-
-