Commit 0fb946aa authored by Yann Ramusat's avatar Yann Ramusat

Javadoc for the new controler.

parent bcc66c9d
...@@ -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();
......
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