Commit d095695f authored by Enteocline's avatar Enteocline
Browse files

Commentaire et typos documentation

parent 2ae8bac1
......@@ -12,7 +12,7 @@ public class BehaviourHolder {
private BehaviourHolder() {
}
/** Allow the package to set a nex FollowerBehaviour for the BehaviourHolder */
/** Allow the package to set a new FollowerBehaviour for the BehaviourHolder */
void SetFollowerBehaviour(FollowerBehaviour fb) {
fob = fb;
}
......
......@@ -61,8 +61,8 @@ public class FollowerBehaviour {
}
/** Output the list of Character satysfying all the properties in target
* @param list A list of Character in which you want to keep only the one satisfying the propertie in target
* @param target : a list of words, representing a target in an instruction in the IGP Panel
* @param list a list of Character in which you want to keep only the one satisfying the propertie in target
* @param target a list of words, representing a target in an instruction in the IGP Panel
*/
private List<Character> findCharacter(List<Character> list, ArrayList<String> target) {
switch (target.get(0)) {
......
......@@ -12,20 +12,21 @@ import java.io.ByteArrayInputStream;
import java.util.*;
/** First iteration of the panel for ingame programming
@author Alexis Ghyselen & William Babonnaud **/
* @author Alexis Ghyselen & William Babonnaud
*/
public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
private static final long serialVersionUID = 1L;
/** nbf is the number of rules we want in our panel, here we decide that we will work with 8 possible rules **/
/** nbf is the number of rules we want in our panel, here we decide that we will work with 8 possible rules */
private int nbf = 8 ;
/** Vswitch remember the last button used, that will allow us to switch two rules **/
/** vswitch remember the last button used, that will allow us to switch two rules */
private int vswitch = -1 ;
/** fob is the FollowerBheaviour creater by the IGPpanel, it's is linked to the BehaviourHolder when you press back **/
/** fob is the FollowerBheaviour created by the IGPpanel, it's is linked to the BehaviourHolder when you press back */
private FollowerBehaviour fob = new FollowerBehaviour(nbf);
/** This is the elements of our panel, for each rule, we got a switch button, a textfield to write the rule and an hint label that is useless for now" **/
/** This is the elements of our panel, for each rule, we got a switch button, a textfield to write the rule and an hint label that is useless for now */
private JButton[] bswitch = new JButton[nbf];
private JTextField[] prflabel = new JTextField[nbf];
private JLabel[] hintlabel = new JLabel[nbf];
......@@ -39,7 +40,6 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
* instruction is correct, and in red otherwise.
* TODO We should find some more harmonious colors and add them to GUIColorAndFonts.
*/
parselistener = new ActionListener[nbf];
for(int i=0; i<nbf;i++) {
......@@ -63,13 +63,13 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
};
};
/** Creation of the content of the IGP_Panel **/
/** Creation of the content of the IGP_Panel */
setLayout(new GridBagLayout());
GridBagConstraints c;
/** Creation of the titlePanel **/
/** Creation of the titlePanel */
JPanel titlePanel = new JPanel();
titlePanel.setOpaque(true);
titlePanel.setBackground(GUIColorsAndFonts.backGround2);
......@@ -79,12 +79,12 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
titleLabel.setFont(GUIColorsAndFonts.titleFont1);
titlePanel.add(titleLabel);
/** Grid constraint for the title panel **/
/** Grid constraint for the title panel */
c = new GridBagConstraints();
c.gridx=0; c.gridy=0; c.gridwidth=1; c.gridheight=1;c.weightx=1;c.weighty=0.5;c.fill=GridBagConstraints.BOTH;
add(titlePanel, c);
/** Creation of the buttonPanel **/
/** Creation of the buttonPanel */
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new GridBagLayout());
buttonPanel.setOpaque(true);
......@@ -106,9 +106,9 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
buttonPanel.add(Box.createHorizontalGlue(), c2);
} */
/** Creation of the elements of the IGP_Panel **/
/** Creation of the elements of the IGP_Panel */
for (int i =0; i < nbf ; i++) {
/** The button that will allow the user to switch rules **/
/** The button that will allow the user to switch rules */
bswitch[i] = new JButton(Integer.toString(i));
bswitch[i].setFont(GUIColorsAndFonts.buttonFont1);
bswitch[i].setForeground(GUIColorsAndFonts.fontColor1);
......@@ -118,7 +118,7 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
c2 = new GridBagConstraints();
c2.gridx=1; c2.gridy=(i+1); c2.gridwidth=1; c2.gridheight=1; c2.weightx=1; c2.weighty=1; c2.fill=GridBagConstraints.BOTH;
buttonPanel.add(bswitch[i], c2);
/** Textfield to enter the rules **/
/** Textfield to enter the rules */
prflabel[i] = new JTextField();
prflabel[i].setColumns(20);
prflabel[i].setFont(GUIColorsAndFonts.smallFont1);
......@@ -129,7 +129,7 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
c2 = new GridBagConstraints();
c2.gridx=3; c2.gridy=(i+1); c2.gridwidth=3; c2.gridheight=1; c2.weightx=3; c2.weighty=1; c2.fill=GridBagConstraints.BOTH;
buttonPanel.add(prflabel[i],c2);
/** Label that will give hint to the user **/
/** Label that will give hint to the user */
hintlabel[i] = new JLabel("Exemple : attaquer ennemi avec PV=100% ou possédant potion");
hintlabel[i].setFont(GUIColorsAndFonts.smallFont1);
hintlabel[i].setForeground(GUIColorsAndFonts.fontColor1);
......@@ -139,7 +139,7 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
}
/** Back button **/
/** Back button */
JButton exitButton = new JButton();
exitButton.setFont(GUIColorsAndFonts.buttonFont1);
exitButton.setText("Back");
......@@ -151,7 +151,7 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
c2.gridx=0; c2.gridy=(nbf+1); c2.gridwidth=2; c2.gridheight=1; c2.weightx=1; c2.weighty=1; c2.fill=GridBagConstraints.BOTH;
buttonPanel.add(exitButton, c2);
/** Adding the button panel to the menu **/
/** Adding the button panel to the menu */
c = new GridBagConstraints();
c.gridx=0; c.gridy=1; c.gridwidth=1; c.gridheight=1;c.weightx=1;c.weighty=10;c.fill=GridBagConstraints.BOTH;
add(buttonPanel, c);
......@@ -174,7 +174,7 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
}
/** ActionListener that will allow to switch rules **/
/** ActionListener that will allow to switch rules */
private ActionListener bswitchlistener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
......@@ -200,7 +200,7 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
}
}
};
/** ActionListener to exit the IGP_Panel and update BehaviourHolder **/
/** ActionListener to exit the IGP_Panel and update BehaviourHolder */
private ActionListener exitButtonListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
......@@ -212,7 +212,7 @@ public class IGPpanel extends graphics.guiSkeleton.guiPanel.GUIPanel{
private ActionListener[] parselistener;
/**
/**
* Convert a String to an equivalent InputStream.
* @param s the String to convert.
* @return the equivalent InputStream.
......
/**
* Grammaire du langage de script.
* Décrit comment analyser les instructions. Le parser sera généré par JavaCC.
* Grammar for scripting language.
* Give the methods for parsing instructions. Parser will be generated by JavaCC.
* @author William Babonnaud
*
*/
options {
......@@ -15,13 +14,13 @@ package ingame_programming;
import java.util.ArrayList;
/** Interpréteur du langage de script */
/** Define the parser class. */
public class Script {
/**
* Check whether the input is correct.
* @return a ArrayList of String with first element equal to "NULL"
* if the input is wrong
* if there is an error in the input.
*/
public ArrayList<String> checkInput() {
ArrayList<String> msg = new ArrayList<String>();
......@@ -73,14 +72,17 @@ TOKEN :
|
< VALPRCT: ( ( ["1"-"9"] )? ["0"-"9"] | "100" ) "%" >
|
< ITEM: "fl" ("è" | "e") "che" | "potion" >
// Il faudra sûrement recenser tous les objets existants.
< ITEM: "fl" ("è" | "e") "che" | "potion" > // We will have to create item and list them.
|
< NAME: ["a"-"z","A"-"Z","é","è","É","È"] ( ["a"-"z","A"-"Z","0"-"9","_","é","è","É","È"] )+ >
|
< SPACE: ( " " )+ >
}
/**
* Implement parsing.
* @return an ArrayList of String encoding a syntactic tree of the analysed instruction.
*/
ArrayList<String> Instruction() :
{
ArrayList<String> target = new ArrayList<String>();
......@@ -133,7 +135,10 @@ ArrayList<String> Instruction() :
}
}
/** Détail des options. */
/**
* Method for options analysis.
* @return a ArrayList of String encoding a syntactic tree of the option instruction.
*/
ArrayList<String> Option() :
{
ArrayList<String> tmp1 = new ArrayList<String>();
......
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