Commit f3e8f66f authored by Yann Ramusat's avatar Yann Ramusat
Browse files

Work on javadoc.

parent fa0cf61c
......@@ -9,7 +9,7 @@ import java.util.ArrayList;
/**
* Created by Yann RAMUSAT on 30/12/15.
*
* This class allows to create a new entity of the indicated type.
* This class allows to create a new entity of indicated type.
* This class provides a way to start or stop all the current working entities (for example when initializing and quitting a map).
*
* Note: A part of this code (killAll and startAll) is inspired by the previous class AIControler implemented by Arnaud Guerquin.
......
......@@ -6,7 +6,7 @@ import artificial_intelligence.GameOpt;
import core.zone.Direction;
/**
* @author Remy Garnier && Yann Ramusat
* @author Remy GARNIER && Yann RAMUSAT
*
* This class provides essentials tools for pathfinding and other ubiquitous abilities.
*/
......@@ -31,7 +31,7 @@ public class AI {
}
/**
*
* Set a game opt.
* @param Game Options
*/
public void setOpt(GameOpt opt) {
......@@ -39,8 +39,16 @@ public class AI {
}
/**
* Implementation of the A* algorithm
*/
* Implementation of the A* algorithm.
*
* @param obj_x
* @param obj_y
* @param source_x
* @param source_y
* @param width
* @param height
* @return the direction to go
*/
public static Direction alpha_star(int obj_x, int obj_y, int source_x, int source_y,int width,int height) {
AITile obj = new AITile(obj_x, obj_y);
AITile begin = new AITile(source_x, source_y);
......
......@@ -3,7 +3,7 @@ package artificial_intelligence.AlphaStar;
import core.zone.Direction;
/**
* @author Remy Garnier && Yann Ramusat
* @author Remy GARNIER && Yann RAMUSAT
*
* This class stands for a tile like in MapGen but with the needs of AI.
*/
......@@ -33,7 +33,10 @@ public class AITile {
public boolean isObstacle(){return false;}
/**
* Return information about the closest tiles.
* @return
*/
public AITile[] neighbors(){
AITile[] neighbors=new AITile[4];
neighbors[0]=new AITile(x,y+32);
......@@ -49,7 +52,9 @@ public class AITile {
return neighbors;
}
//Sert à renvoyer une orientatation lorsque l'onveut arriver sur la ca
/**
* Sert à renvoyer une orientation lorsque l'on veut arriver sur la case
*/
public core.zone.Direction orientation(AITile start)
{
//On a cherché le chemin dans le sens inverse, on doit le retourner pour arriver dans le von sen
......
......@@ -11,13 +11,20 @@ public class AITileQueueElement implements Comparable<AITileQueueElement>{
private AITile caseElement;
private double value;
/**
* Enqueue.
* @param element
* @param d
*/
public AITileQueueElement(AITile element, double d) {
caseElement=Objects.requireNonNull(element);
value=d;
}
/**
* Getter caseElement
* @return the tile
*/
public AITile getCase() {
return caseElement;
}
......
......@@ -6,10 +6,10 @@ import org.junit.runners.Suite;
/**
* Created by Yann Ramusat on 31/12/15.
*
* TestSuite for the network package.
* TestSuite for the AI package.
* Will launch automatically all the JUnits tests.
*
* Very helpful, code found in NetworkTests.
* Note: very helpful, code found in NetworkTests.
*/
@RunWith(Suite.class)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment