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;
public class AIControler {
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) {
AbstractEntity ai = null;
switch(type) {
......@@ -35,14 +41,25 @@ public class AIControler {
list.add(ai);
}
/**
* Return all the AIs active or created but not active.
* @return the list of AIs
*/
public static ArrayList<AbstractEntity> getList() {
return list;
}
/**
* In order to know how many AIs are created.
* @return the size of the list
*/
public static int getNumber() {
return list.size();
}
/**
* To use for example at the end of a map.
*/
public static void killAll(){
for(AbstractEntity ai :list){
ai.setEndThread(false);
......@@ -50,6 +67,9 @@ public class AIControler {
list.clear();
}
/**
* To start all the AIs at the begining of the map and after init complete inialization.
*/
public static void startAll() {
for(AbstractEntity ai :list){
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