Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
the_dungeon_project
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
genie_logiciel_2015
the_dungeon_project
Commits
0fb946aa
Commit
0fb946aa
authored
Dec 31, 2015
by
Yann Ramusat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Javadoc for the new controler.
parent
bcc66c9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
src/artificial_intelligence/AIControler.java
src/artificial_intelligence/AIControler.java
+20
-0
No files found.
src/artificial_intelligence/AIControler.java
View file @
0fb946aa
...
@@ -16,6 +16,12 @@ import core.relayer.Relayer;
...
@@ -16,6 +16,12 @@ import core.relayer.Relayer;
public
class
AIControler
{
public
class
AIControler
{
private
static
ArrayList
<
AbstractEntity
>
list
=
new
ArrayList
<>();
private
static
ArrayList
<
AbstractEntity
>
list
=
new
ArrayList
<>();
/**
* Create a new AI of indicated type given as context a gameContent and a relayer to contact.
* @param gameContent
* @param dmr
* @param type the behaviour of the AI to create
*/
public
static
void
add
(
GameContent
gameContent
,
Relayer
dmr
,
EnumBehaviourType
type
)
{
public
static
void
add
(
GameContent
gameContent
,
Relayer
dmr
,
EnumBehaviourType
type
)
{
AbstractEntity
ai
=
null
;
AbstractEntity
ai
=
null
;
switch
(
type
)
{
switch
(
type
)
{
...
@@ -35,14 +41,25 @@ public class AIControler {
...
@@ -35,14 +41,25 @@ public class AIControler {
list
.
add
(
ai
);
list
.
add
(
ai
);
}
}
/**
* Return all the AIs active or created but not active.
* @return the list of AIs
*/
public
static
ArrayList
<
AbstractEntity
>
getList
()
{
public
static
ArrayList
<
AbstractEntity
>
getList
()
{
return
list
;
return
list
;
}
}
/**
* In order to know how many AIs are created.
* @return the size of the list
*/
public
static
int
getNumber
()
{
public
static
int
getNumber
()
{
return
list
.
size
();
return
list
.
size
();
}
}
/**
* To use for example at the end of a map.
*/
public
static
void
killAll
(){
public
static
void
killAll
(){
for
(
AbstractEntity
ai
:
list
){
for
(
AbstractEntity
ai
:
list
){
ai
.
setEndThread
(
false
);
ai
.
setEndThread
(
false
);
...
@@ -50,6 +67,9 @@ public class AIControler {
...
@@ -50,6 +67,9 @@ public class AIControler {
list
.
clear
();
list
.
clear
();
}
}
/**
* To start all the AIs at the begining of the map and after init complete inialization.
*/
public
static
void
startAll
()
{
public
static
void
startAll
()
{
for
(
AbstractEntity
ai
:
list
){
for
(
AbstractEntity
ai
:
list
){
ai
.
start
();
ai
.
start
();
...
...
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