diff --git a/src/artificial_intelligence/AIControler.java b/src/artificial_intelligence/AIControler.java index 9c4253c1eacdc4843c12309ca09a49741a99be41..17b46c75c53a03fc9984f7a31dfacddebba4470d 100644 --- a/src/artificial_intelligence/AIControler.java +++ b/src/artificial_intelligence/AIControler.java @@ -16,6 +16,12 @@ import core.relayer.Relayer; public class AIControler { private static ArrayList 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 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();