Commit ffd27a9d authored by Enteocline's avatar Enteocline

Premier pas pour l'interprétation du script vers l'IA.

parent 21e07198
package ingame_programming;
/**
* This class is used to store and analyse data from IGPpanel.
* @author William Babonnaud
*/
public class BehaviourHolder {
/** Data are stored under the form of a FollowerBehaviour instance */
private FollowerBehaviour fob = new FollowerBehaviour(0);
/** Constructor */
public BehaviourHolder() {
}
}
package ingame_programming;
import java.io.InputStream;
/**
* This class is used to register data from IGPpanel.
* @author William Babonnaud
*/
public class FollowerBehaviour {
/** Number of rules to consider */
private int numberOfRules;
/** Array for store instructions as InputStream */
private InputStream[] instructions;
/** Constructor */
public FollowerBehaviour(int nRules) {
numberOfRules = nRules;
instructions = new InputStream[numberOfRules];
}
/**
* Set instruction value, given its position in the rules array.
* @param the InputStream value to set
* @param an integer strictly lesser than numberOfRules
*/
public void setNthInstruction(InputStream instr, int n) {
instructions[n] = instr;
}
}
......@@ -195,6 +195,17 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
return is;
}
/**
* Create an instance of class FollowerBehaviour with the current information
* @return an setted FollowerBehaviour object.
*/
public FollowerBehaviour generateFollower() {
FollowerBehaviour fob = new FollowerBehaviour(nbf);
for(int i = 0; i < nbf; i++) {
fob.setNthInstruction(stringToStream(prflabel[i].getText()), i);
}
return fob;
}
@Override
......
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