Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
f3e8f66f
Commit
f3e8f66f
authored
Dec 31, 2015
by
Yann Ramusat
Browse files
Work on javadoc.
parent
fa0cf61c
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/artificial_intelligence/AI_Controler.java
View file @
f3e8f66f
...
...
@@ -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.
...
...
src/artificial_intelligence/AlphaStar/AI.java
View file @
f3e8f66f
...
...
@@ -6,7 +6,7 @@ import artificial_intelligence.GameOpt;
import
core.zone.Direction
;
/**
* @author Remy G
arnier
&& Yann R
amusat
* @author Remy G
ARNIER
&& Yann R
AMUSAT
*
* 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
);
...
...
src/artificial_intelligence/AlphaStar/AITile.java
View file @
f3e8f66f
...
...
@@ -3,7 +3,7 @@ package artificial_intelligence.AlphaStar;
import
core.zone.Direction
;
/**
* @author Remy G
arnier
&& Yann R
amusat
* @author Remy G
ARNIER
&& Yann R
AMUSAT
*
* 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
...
...
src/artificial_intelligence/AlphaStar/AITileQueueElement.java
View file @
f3e8f66f
...
...
@@ -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
;
}
...
...
src/artificial_intelligence/test/unitTest/AITests.java
View file @
f3e8f66f
...
...
@@ -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.
*
*
V
ery helpful, code found in NetworkTests.
*
Note: v
ery helpful, code found in NetworkTests.
*/
@RunWith
(
Suite
.
class
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment