diff --git a/docs/tina.png b/docs/tina.png new file mode 100644 index 0000000..c9519f7 Binary files /dev/null and b/docs/tina.png differ diff --git a/runtime-workspace/fr.n7.game.examples/enigmeLibre.game b/runtime-workspace/fr.n7.game.examples/enigmeLibre.game index 15fb4f3..daea201 100644 --- a/runtime-workspace/fr.n7.game.examples/enigmeLibre.game +++ b/runtime-workspace/fr.n7.game.examples/enigmeLibre.game @@ -59,6 +59,7 @@ Personnes: - Description1: texte: "la mauvaise reponse" condition: true + - Combattre: visible: true connaissances: @@ -74,7 +75,7 @@ Personnes: objets_conso: descriptions: - Description1: - texte: "la bonne reponse" + texte: "Se faire taper" condition: true - Action_2: @@ -86,7 +87,7 @@ Personnes: - tentative descriptions: - Description1: - texte: "la mauvaise reponse" + texte: "Fuir" condition: true Territoire: diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Action.java b/runtime-workspace/fr.n7.game.examples/src-gen/Action.java index f456faf..4729abe 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Action.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Action.java @@ -1,6 +1,7 @@ import java.util.List; public class Action { + String nom; Condition visible; List connaissances; List objetsRecus; @@ -9,12 +10,14 @@ public class Action { List descriptions; public Action( + String nom, Condition visible, Condition finInterraction, List connaissances, List objetsRecus, List objetsConso, List descriptions) { + this.nom = nom; this.visible = visible; this.connaissances = connaissances; this.objetsRecus = objetsRecus; @@ -46,4 +49,9 @@ public class Action { } return "No desc"; } + + public static Action search(List list, String name) { + return list.stream().filter(o -> o.nom.equals(name)).findFirst() + .orElseThrow(() -> new IllegalArgumentException("No data found")); + } } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Chemin.java b/runtime-workspace/fr.n7.game.examples/src-gen/Chemin.java index 1b960dc..15a6dbc 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Chemin.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Chemin.java @@ -40,10 +40,10 @@ public class Chemin { public String toString() { for (Description d : descriptions) { if (d.condition.evaluer()) { - return d.toString(); + return this.nom + " (" + d + ")"; } } - return "No desc"; + return "(no description)"; } public Lieu emprunter() { @@ -60,4 +60,9 @@ public class Chemin { } return this.lieuOut; } + + public static Chemin search(List list, String name) { + return list.stream().filter(o -> o.nom.equals(name)).findFirst() + .orElseThrow(() -> new IllegalArgumentException("No data found")); + } } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Condition.java b/runtime-workspace/fr.n7.game.examples/src-gen/Condition.java index 7231129..aec4808 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Condition.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Condition.java @@ -1,21 +1,19 @@ import java.util.List; -import java.util.ArrayList; public class Condition { - List conditionEts; + List> conditionsNormaleDisjonctive; - public Condition(List conditionEts) { - this.conditionEts = conditionEts; + public Condition(List> conditions) { + this.conditionsNormaleDisjonctive = conditions; } public Boolean evaluer() { - for (ConditionEt cond : conditionEts) { - if (cond.evaluer()) { - return true; - } - } - return false; + + return conditionsNormaleDisjonctive.stream() + .anyMatch( + conditionOU -> conditionOU.stream() + .allMatch(c -> c.evaluer())); } } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/ConditionEt.java b/runtime-workspace/fr.n7.game.examples/src-gen/ConditionEt.java index 5458432..93165dd 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/ConditionEt.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/ConditionEt.java @@ -1,5 +1,4 @@ import java.util.List; -import java.util.ArrayList; public class ConditionEt { diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Connaissance.java b/runtime-workspace/fr.n7.game.examples/src-gen/Connaissance.java index 044e202..6092f5a 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Connaissance.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Connaissance.java @@ -18,9 +18,14 @@ public class Connaissance { public String toString() { for (Description d : this.descriptions) { if (d.condition.evaluer()) { - return "(" + this.nom + " : " + d + ")"; + return this.nom + " (" + d + ")"; } } - return "(" + this.nom + ")"; + return "(no description)"; + } + + public static Connaissance search(List list, String name) { + return list.stream().filter(o -> o.nom.equals(name)).findFirst() + .orElseThrow(() -> new IllegalArgumentException("No data found")); } } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Description.java b/runtime-workspace/fr.n7.game.examples/src-gen/Description.java index adb783b..fe30c52 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Description.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Description.java @@ -1,10 +1,15 @@ +import java.util.List; + public class Description { String texte; Condition condition; + String nom; public Description( + String nom, String texte, Condition condition) { + this.nom = nom; this.texte = texte; this.condition = condition; } @@ -13,4 +18,9 @@ public class Description { public String toString() { return this.texte; } + + public static Description search(List list, String name) { + return list.stream().filter(o -> o.nom.equals(name)).findFirst() + .orElseThrow(() -> new IllegalArgumentException("No data found")); + } } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Interaction.java b/runtime-workspace/fr.n7.game.examples/src-gen/Interaction.java index af17beb..14fb619 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Interaction.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Interaction.java @@ -1,10 +1,9 @@ import java.util.List; import java.util.ArrayList; -import java.io.InputStreamReader; import java.io.BufferedReader; -import java.io.IOException; public class Interaction { + String nom; Condition visible; List connaissances; List objetsRecus; @@ -12,11 +11,13 @@ public class Interaction { List actions; public Interaction( + String nom, Condition visible, List connaissances, List objetsRecus, List objetsConso, List actions) { + this.nom = nom; this.visible = visible; this.connaissances = connaissances; this.objetsRecus = objetsRecus; @@ -77,4 +78,9 @@ public class Interaction { } return res; } + + public static Interaction search(List list, String name) { + return list.stream().filter(o -> o.nom.equals(name)).findFirst() + .orElseThrow(() -> new IllegalArgumentException("No data found")); + } } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Jeu.java b/runtime-workspace/fr.n7.game.examples/src-gen/Jeu.java index 70d5170..6ae4d2d 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Jeu.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Jeu.java @@ -1,6 +1,5 @@ import java.io.InputStreamReader; import java.io.BufferedReader; -import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -47,14 +46,17 @@ public class Jeu { // tant qu'on est pas sur un lieu de fin mainloop: while (!lieu.fin.evaluer()) { + int selection = 0; + List choix = new ArrayList<>(); clearScreen(); + System.out.println("Lieu actuel: " + lieu + "\n"); System.out.println("Explorateur:\n" + Jeu.explorateur + "\n"); System.out.println("-".repeat(50)); for (Personne p : lieu.personnes) { if (p.visible.evaluer() && p.obligatoire.evaluer() || p == personne) { - System.out.println(p + " :"); + System.out.println(p + ":"); p.interragir(reader, lieu); personne = null; @@ -71,39 +73,41 @@ public class Jeu { } } - int k = 0; - List chemins_choix = new ArrayList<>(); for (Chemin c : territoire.chemins) { if (c.lieuIn == lieu) { - if (c.visible.evaluer() && c.ouvert.evaluer()) { - chemins_choix.add(c); - System.out.println("[" + k + "] " + c); - k++; + if (c.visible.evaluer()) { + if (c.ouvert.evaluer()) { + System.out.println("[" + choix.size() + "] " + c); + choix.add(c); + } else { + System.out.println("[X] " + c); + } } } } - List personnes_choix = new ArrayList<>(); for (Personne p : personnes) { if (lieu.personnes.contains(p)) { if (p.visible.evaluer()) { - personnes_choix.add(p); - System.out.println("[" + k + "] " + p); - k++; + System.out.println("[" + choix.size() + "] " + p); + choix.add(p); } } } - int choix = 0; try { System.out.print("\nChoix : "); - choix = Integer.parseInt(reader.readLine()); + selection = Integer.parseInt(reader.readLine()); + Object choix_selection = choix.get(selection); - if (choix < chemins_choix.size()) { - lieu = chemins_choix.get(choix).emprunter(); + if (choix_selection instanceof Chemin) { + lieu = ((Chemin) choix_selection).emprunter(); + } else if (choix_selection instanceof Personne) { + personne = (Personne) choix_selection; } else { - personne = personnes_choix.get(choix - chemins_choix.size()); + throw new UnsupportedOperationException(); } + } catch (Exception e) { continue; } @@ -112,3 +116,7 @@ public class Jeu { System.out.println("FIN : " + lieu.nom); } } + +// TODO: faire le truc des dépots dans les lieux +// TODO: arreter de créer pleins d'objets et créer des objets anonymes que l'on +// place dans une hashmap avec son nom ? \ No newline at end of file diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Lieu.java b/runtime-workspace/fr.n7.game.examples/src-gen/Lieu.java index 4be1123..8005dd1 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Lieu.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Lieu.java @@ -33,4 +33,9 @@ public class Lieu { public String toString() { return nom; } + + public static Lieu search(List list, String name) { + return list.stream().filter(o -> o.nom.equals(name)).findFirst() + .orElseThrow(() -> new IllegalArgumentException("No data found")); + } } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Objet.java b/runtime-workspace/fr.n7.game.examples/src-gen/Objet.java index df7b075..6614fec 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Objet.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Objet.java @@ -19,13 +19,17 @@ public class Objet { @Override public String toString() { - String str = null; for (Description d : this.descriptions) { if (d.condition.evaluer()) { - str = this.nom + "(" + d + ")"; - break; + return this.nom + " (" + d + ")"; } } - return str; + return "(no description)"; } + + public static Objet search(List list, String name) { + return list.stream().filter(o -> o.nom.equals(name)).findFirst() + .orElseThrow(() -> new IllegalArgumentException("No data found")); + } + } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Personne.java b/runtime-workspace/fr.n7.game.examples/src-gen/Personne.java index 3687b6e..d24dc30 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Personne.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Personne.java @@ -1,4 +1,7 @@ import java.util.List; + +import javax.print.attribute.standard.PresentationDirection; + import java.io.InputStreamReader; import java.io.BufferedReader; @@ -32,4 +35,9 @@ public class Personne { public String toString() { return nom; } + + public static Personne search(List list, String name) { + return list.stream().filter(o -> o.nom.equals(name)).findFirst() + .orElseThrow(() -> new IllegalArgumentException("No data found")); + } } diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Prototype.java b/runtime-workspace/fr.n7.game.examples/src-gen/Prototype.java index cdb107e..a77f738 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Prototype.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Prototype.java @@ -3,98 +3,121 @@ import java.util.ArrayList; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; +import java.util.Map; +import static java.util.Map.entry; public class Prototype { public static void main(String[] args) { // "Objets" - -List jeu_objets = new ArrayList<>(); - - List objet_tentative_descriptions = new ArrayList<>(); - - List objet_tentative_description_1_conditions_ET_list = new ArrayList<>(); - - List objet_tentative_description_1_conditions_TEST_list = new ArrayList<>(); - - objet_tentative_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - objet_tentative_description_1_conditions_ET_list.add( - new ConditionEt(objet_tentative_description_1_conditions_TEST_list) - ); - - Condition objet_tentative_description_1_condition = new Condition(objet_tentative_description_1_conditions_ET_list); - - objet_tentative_descriptions.add( - new Description( - "permet repondre une question du sphinx", - objet_tentative_description_1_condition +Map jeu_objets = Map.ofEntries( + entry( + "warpToken", + new Objet( + "warpToken", + 1, + new Condition( + List.of( + List.of( + new ConditionBoolean(true) + , + new ConditionBoolean(true) + , + new ConditionBoolean(true) + + ), + List.of( + new ConditionBoolean(true) + , + new ConditionBoolean(false) + + ), + List.of( + new ConditionBoolean(false) + + ) + ) + ), + List.of( + new Description( + "warpToken description", + new Condition( + List.of( + List.of( + new ConditionBoolean(true) + + ) + ) + ) + ) ) - ); - List objet_visible_tentative_conditions_ET_list = new ArrayList<>(); - - List objet_visible_tentative_conditions_TEST_list = new ArrayList<>(); - - objet_visible_tentative_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - objet_visible_tentative_conditions_ET_list.add( - new ConditionEt(objet_visible_tentative_conditions_TEST_list) - ); - - Condition objet_visible_tentative_condition = new Condition(objet_visible_tentative_conditions_ET_list); - Objet objet_tentative = new Objet( - "tentative", - 1, - objet_visible_tentative_condition, - objet_tentative_descriptions - ); - jeu_objets.add(objet_tentative); + ) + ), + entry( + "warpTicket", + new Objet( + "warpTicket", + 1, + new Condition( + List.of( + List.of( + new ConditionBoolean(true) + + ) + ) + ), + List.of( + new Description( + "warpTicket description", + new Condition( + List.of( + List.of( + new ConditionBoolean(true) + + ) + ) + ) + ) + ) + ) + ), + entry( + "warpReceipt", + new Objet( + "warpReceipt", + 1, + new Condition( + List.of( + List.of( + new ConditionBoolean(true) + + ) + ) + ), + List.of( + new Description( + "warpReceipt description", + new Condition( + List.of( + List.of( + new ConditionBoolean(true) + + ) + ) + ) + ) + ) + ) + ) +); // "Connaissances" +Map jeu_objets = Map.ofEntries( -List jeu_connaissances = new ArrayList<>(); - List connaissance_Reussite_descriptions = new ArrayList<>(); - - List connaissance_Reussite_description_1_conditions_ET_list = new ArrayList<>(); - - List connaissance_Reussite_description_1_conditions_TEST_list = new ArrayList<>(); - - connaissance_Reussite_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - connaissance_Reussite_description_1_conditions_ET_list.add( - new ConditionEt(connaissance_Reussite_description_1_conditions_TEST_list) - ); - - Condition connaissance_Reussite_description_1_condition = new Condition(connaissance_Reussite_description_1_conditions_ET_list); - - connaissance_Reussite_descriptions.add( - new Description( - "Permet de se casser de la", - connaissance_Reussite_description_1_condition - ) - ); - List connaissance_visible_Reussite_conditions_ET_list = new ArrayList<>(); - - List connaissance_visible_Reussite_conditions_TEST_list = new ArrayList<>(); - - connaissance_visible_Reussite_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - connaissance_visible_Reussite_conditions_ET_list.add( - new ConditionEt(connaissance_visible_Reussite_conditions_TEST_list) - ); - - Condition connaissance_visible_Reussite_condition = new Condition(connaissance_visible_Reussite_conditions_ET_list); - Connaissance connaissance_Reussite = new Connaissance( - "Reussite", - connaissance_visible_Reussite_condition, - connaissance_Reussite_descriptions - ); - jeu_connaissances.add(connaissance_Reussite); +Map jeu_objets = Map.ofEntries( +); + // "Transformations" @@ -104,14 +127,16 @@ List jeu_transformations = new ArrayList<>(); // "Explorateur" List explorateur_inventaire = new ArrayList<>(); - explorateur_inventaire.add(objet_tentative); - explorateur_inventaire.add(objet_tentative); - explorateur_inventaire.add(objet_tentative); + explorateur_inventaire.addAll( + List.of( + jeu_objets.get("warpToken") + ) + ); List explorateur_connaissances = new ArrayList<>(); Jeu.explorateur = new Explorateur( - 3, + 5, explorateur_connaissances, explorateur_inventaire ); @@ -120,598 +145,170 @@ Jeu.explorateur = new Explorateur( List jeu_personnes = new ArrayList<>(); - List personne_visible_Sphinx_1_conditions_ET_list = new ArrayList<>(); + List personne_cashier_1_interactions = new ArrayList<>(); - List personne_visible_Sphinx_1_conditions_TEST_list = new ArrayList<>(); - - personne_visible_Sphinx_1_conditions_TEST_list.add( - new ConditionConnaissance( - connaissance_Reussite, - true - ) - ); - personne_visible_Sphinx_1_conditions_TEST_list.add( - new ConditionObjet( - objet_tentative, - ">", - 0 - ) - ); - personne_visible_Sphinx_1_conditions_ET_list.add( - new ConditionEt(personne_visible_Sphinx_1_conditions_TEST_list) - ); - - Condition personne_visible_Sphinx_1_condition = new Condition(personne_visible_Sphinx_1_conditions_ET_list); - List personne_obligatoire_Sphinx_1_conditions_ET_list = new ArrayList<>(); - - List personne_obligatoire_Sphinx_1_conditions_TEST_list = new ArrayList<>(); - - personne_obligatoire_Sphinx_1_conditions_TEST_list.add( - new ConditionBoolean(false) - ); - personne_obligatoire_Sphinx_1_conditions_ET_list.add( - new ConditionEt(personne_obligatoire_Sphinx_1_conditions_TEST_list) - ); - - Condition personne_obligatoire_Sphinx_1_condition = new Condition(personne_obligatoire_Sphinx_1_conditions_ET_list); - List personne_Sphinx_1_interactions = new ArrayList<>(); - - List personne_Sphinx_1_interaction_visible_1_conditions_ET_list = new ArrayList<>(); + List personne_cashier_1_interaction_1_actions = new ArrayList<>(); - List personne_Sphinx_1_interaction_visible_1_conditions_TEST_list = new ArrayList<>(); - personne_Sphinx_1_interaction_visible_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - personne_Sphinx_1_interaction_visible_1_conditions_ET_list.add( - new ConditionEt(personne_Sphinx_1_interaction_visible_1_conditions_TEST_list) - ); - - Condition personne_Sphinx_1_interaction_visible_1_condition = new Condition(personne_Sphinx_1_interaction_visible_1_conditions_ET_list); - List personne_Sphinx_1_interaction_1_actions = new ArrayList<>(); - - List personne_Sphinx_1_interaction_1_action_visible_1_conditions_ET_list = new ArrayList<>(); + List personne_cashier_1_interaction_1_action_1_connaissances = new ArrayList<>(); + List personne_cashier_1_interaction_1_action_1_objets_conso = new ArrayList<>(); + personne_cashier_1_interaction_1_action_1_objets_conso.add(objet_warpTicket); + List personne_cashier_1_interaction_1_action_1_objets_recus = new ArrayList<>(); + personne_cashier_1_interaction_1_action_1_objets_recus.add(objet_warpToken); + personne_cashier_1_interaction_1_action_1_objets_recus.add(objet_warpReceipt); - List personne_Sphinx_1_interaction_1_action_visible_1_conditions_TEST_list = new ArrayList<>(); - - personne_Sphinx_1_interaction_1_action_visible_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - personne_Sphinx_1_interaction_1_action_visible_1_conditions_ET_list.add( - new ConditionEt(personne_Sphinx_1_interaction_1_action_visible_1_conditions_TEST_list) - ); - - Condition personne_Sphinx_1_interaction_1_action_visible_1_condition = new Condition(personne_Sphinx_1_interaction_1_action_visible_1_conditions_ET_list); - List personne_Sphinx_1_interaction_1_action_fin_1_conditions_ET_list = new ArrayList<>(); - - List personne_Sphinx_1_interaction_1_action_fin_1_conditions_TEST_list = new ArrayList<>(); - - personne_Sphinx_1_interaction_1_action_fin_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - personne_Sphinx_1_interaction_1_action_fin_1_conditions_ET_list.add( - new ConditionEt(personne_Sphinx_1_interaction_1_action_fin_1_conditions_TEST_list) - ); - - Condition personne_Sphinx_1_interaction_1_action_fin_1_condition = new Condition(personne_Sphinx_1_interaction_1_action_fin_1_conditions_ET_list); - List personne_Sphinx_1_interaction_1_action_1_descriptions = new ArrayList<>(); - - List personne_Sphinx_1_interaction_1_action_1_description_1_conditions_ET_list = new ArrayList<>(); - - List personne_Sphinx_1_interaction_1_action_1_description_1_conditions_TEST_list = new ArrayList<>(); - - personne_Sphinx_1_interaction_1_action_1_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - personne_Sphinx_1_interaction_1_action_1_description_1_conditions_ET_list.add( - new ConditionEt(personne_Sphinx_1_interaction_1_action_1_description_1_conditions_TEST_list) - ); - - Condition personne_Sphinx_1_interaction_1_action_1_description_1_condition = new Condition(personne_Sphinx_1_interaction_1_action_1_description_1_conditions_ET_list); - - personne_Sphinx_1_interaction_1_action_1_descriptions.add( - new Description( - "la bonne reponse", - personne_Sphinx_1_interaction_1_action_1_description_1_condition - ) - ); - - List personne_Sphinx_1_interaction_1_action_1_connaissances = new ArrayList<>(); - personne_Sphinx_1_interaction_1_action_1_connaissances.add(connaissance_Reussite); - List personne_Sphinx_1_interaction_1_action_1_objets_conso = new ArrayList<>(); - // TODO: OMG C DÉGUEULASSE -> LE FAIRE PARTOUT - List personne_Sphinx_1_interaction_1_action_1_objets_recus = new ArrayList<>(); - - personne_Sphinx_1_interaction_1_actions.add( + personne_cashier_1_interaction_1_actions.add( new Action( - personne_Sphinx_1_interaction_1_action_visible_1_condition, - personne_Sphinx_1_interaction_1_action_fin_1_condition, - personne_Sphinx_1_interaction_1_action_1_connaissances, - personne_Sphinx_1_interaction_1_action_1_objets_recus, - personne_Sphinx_1_interaction_1_action_1_objets_conso, - personne_Sphinx_1_interaction_1_action_1_descriptions + personne_cashier_1_interaction_1_action_visible_1_condition, + personne_cashier_1_interaction_1_action_fin_1_condition, + personne_cashier_1_interaction_1_action_1_connaissances, + personne_cashier_1_interaction_1_action_1_objets_recus, + personne_cashier_1_interaction_1_action_1_objets_conso, + personne_cashier_1_interaction_1_action_1_descriptions ) ); - List personne_Sphinx_1_interaction_1_action_visible_2_conditions_ET_list = new ArrayList<>(); - - List personne_Sphinx_1_interaction_1_action_visible_2_conditions_TEST_list = new ArrayList<>(); - - personne_Sphinx_1_interaction_1_action_visible_2_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - personne_Sphinx_1_interaction_1_action_visible_2_conditions_ET_list.add( - new ConditionEt(personne_Sphinx_1_interaction_1_action_visible_2_conditions_TEST_list) - ); - - Condition personne_Sphinx_1_interaction_1_action_visible_2_condition = new Condition(personne_Sphinx_1_interaction_1_action_visible_2_conditions_ET_list); - List personne_Sphinx_1_interaction_1_action_fin_2_conditions_ET_list = new ArrayList<>(); - - List personne_Sphinx_1_interaction_1_action_fin_2_conditions_TEST_list = new ArrayList<>(); - - personne_Sphinx_1_interaction_1_action_fin_2_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - personne_Sphinx_1_interaction_1_action_fin_2_conditions_ET_list.add( - new ConditionEt(personne_Sphinx_1_interaction_1_action_fin_2_conditions_TEST_list) - ); - - Condition personne_Sphinx_1_interaction_1_action_fin_2_condition = new Condition(personne_Sphinx_1_interaction_1_action_fin_2_conditions_ET_list); - List personne_Sphinx_1_interaction_1_action_2_descriptions = new ArrayList<>(); - - List personne_Sphinx_1_interaction_1_action_2_description_1_conditions_ET_list = new ArrayList<>(); - - List personne_Sphinx_1_interaction_1_action_2_description_1_conditions_TEST_list = new ArrayList<>(); - - personne_Sphinx_1_interaction_1_action_2_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - personne_Sphinx_1_interaction_1_action_2_description_1_conditions_ET_list.add( - new ConditionEt(personne_Sphinx_1_interaction_1_action_2_description_1_conditions_TEST_list) - ); - - Condition personne_Sphinx_1_interaction_1_action_2_description_1_condition = new Condition(personne_Sphinx_1_interaction_1_action_2_description_1_conditions_ET_list); - - personne_Sphinx_1_interaction_1_action_2_descriptions.add( - new Description( - "la mauvaise reponse", - personne_Sphinx_1_interaction_1_action_2_description_1_condition - ) - ); - List personne_Sphinx_1_interaction_1_action_2_connaissances = new ArrayList<>(); - List personne_Sphinx_1_interaction_1_action_2_objets_conso = new ArrayList<>(); - // TODO: OMG C DÉGUEULASSE -> LE FAIRE PARTOUT - personne_Sphinx_1_interaction_1_action_2_objets_conso.add(objet_tentative); - List personne_Sphinx_1_interaction_1_action_2_objets_recus = new ArrayList<>(); + List personne_cashier_1_interaction_1_action_2_connaissances = new ArrayList<>(); + List personne_cashier_1_interaction_1_action_2_objets_conso = new ArrayList<>(); + List personne_cashier_1_interaction_1_action_2_objets_recus = new ArrayList<>(); - personne_Sphinx_1_interaction_1_actions.add( + personne_cashier_1_interaction_1_actions.add( new Action( - personne_Sphinx_1_interaction_1_action_visible_2_condition, - personne_Sphinx_1_interaction_1_action_fin_2_condition, - personne_Sphinx_1_interaction_1_action_2_connaissances, - personne_Sphinx_1_interaction_1_action_2_objets_recus, - personne_Sphinx_1_interaction_1_action_2_objets_conso, - personne_Sphinx_1_interaction_1_action_2_descriptions + personne_cashier_1_interaction_1_action_visible_2_condition, + personne_cashier_1_interaction_1_action_fin_2_condition, + personne_cashier_1_interaction_1_action_2_connaissances, + personne_cashier_1_interaction_1_action_2_objets_recus, + personne_cashier_1_interaction_1_action_2_objets_conso, + personne_cashier_1_interaction_1_action_2_descriptions ) ); - List personne_Sphinx_1_interaction_1_connaissances = new ArrayList<>(); - List personne_Sphinx_1_interaction_1_objets_conso = new ArrayList<>(); - List personne_Sphinx_1_interaction_1_objets_recus = new ArrayList<>(); + List personne_cashier_1_interaction_1_connaissances = new ArrayList<>(); + List personne_cashier_1_interaction_1_objets_conso = new ArrayList<>(); + List personne_cashier_1_interaction_1_objets_recus = new ArrayList<>(); - personne_Sphinx_1_interactions.add( + personne_cashier_1_interactions.add( new Interaction( - personne_Sphinx_1_interaction_visible_1_condition, - personne_Sphinx_1_interaction_1_connaissances, - personne_Sphinx_1_interaction_1_objets_conso, - personne_Sphinx_1_interaction_1_objets_recus, - personne_Sphinx_1_interaction_1_actions + personne_cashier_1_interaction_visible_1_condition, + personne_cashier_1_interaction_1_connaissances, + personne_cashier_1_interaction_1_objets_conso, + personne_cashier_1_interaction_1_objets_recus, + personne_cashier_1_interaction_1_actions ) ); - Personne personne_Sphinx = new Personne( - "Sphinx", - personne_visible_Sphinx_1_condition, - personne_obligatoire_Sphinx_1_condition, - personne_Sphinx_1_interactions + Personne personne_cashier = new Personne( + "cashier", + personne_visible_cashier_1_condition, + personne_obligatoire_cashier_1_condition, + personne_cashier_1_interactions ); - jeu_personnes.add(personne_Sphinx); + jeu_personnes.add(personne_cashier); // "Lieux" List territoire_lieux = new ArrayList<>(); - List lieu_deposable_1_conditions_ET_list = new ArrayList<>(); - List lieu_deposable_1_conditions_TEST_list = new ArrayList<>(); - - lieu_deposable_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - lieu_deposable_1_conditions_ET_list.add( - new ConditionEt(lieu_deposable_1_conditions_TEST_list) - ); - - Condition lieu_deposable_1_condition = new Condition(lieu_deposable_1_conditions_ET_list); - List lieu_depart_1_conditions_ET_list = new ArrayList<>(); - - List lieu_depart_1_conditions_TEST_list = new ArrayList<>(); - - lieu_depart_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - lieu_depart_1_conditions_ET_list.add( - new ConditionEt(lieu_depart_1_conditions_TEST_list) - ); - - Condition lieu_depart_1_condition = new Condition(lieu_depart_1_conditions_ET_list); - List lieu_fin_1_conditions_ET_list = new ArrayList<>(); - - List lieu_fin_1_conditions_TEST_list = new ArrayList<>(); - - lieu_fin_1_conditions_TEST_list.add( - new ConditionBoolean(false) - ); - lieu_fin_1_conditions_ET_list.add( - new ConditionEt(lieu_fin_1_conditions_TEST_list) - ); - - Condition lieu_fin_1_condition = new Condition(lieu_fin_1_conditions_ET_list); - List lieu_Enigme_1_descriptions = new ArrayList<>(); - - List lieu_Enigme_1_description_1_conditions_ET_list = new ArrayList<>(); - - List lieu_Enigme_1_description_1_conditions_TEST_list = new ArrayList<>(); - - lieu_Enigme_1_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - lieu_Enigme_1_description_1_conditions_ET_list.add( - new ConditionEt(lieu_Enigme_1_description_1_conditions_TEST_list) - ); - - Condition lieu_Enigme_1_description_1_condition = new Condition(lieu_Enigme_1_description_1_conditions_ET_list); - - lieu_Enigme_1_descriptions.add( - new Description( - "lieu de depart", - lieu_Enigme_1_description_1_condition - ) - ); - - List lieu_Enigme_1_personnes = new ArrayList<>(); - lieu_Enigme_1_personnes.add(personne_Sphinx); - List lieu_Enigme_1_objets = new ArrayList<>(); - List lieu_Enigme_1_connaissances = new ArrayList<>(); + List lieu_preWarp_1_personnes = new ArrayList<>(); + lieu_preWarp_1_personnes.add(personne_cashier); + List lieu_preWarp_1_objets = new ArrayList<>(); + List lieu_preWarp_1_connaissances = new ArrayList<>(); // TODO: utiliser un search dans la liste plutot que de déclarer les objets - Lieu lieu_Enigme = new Lieu( - "Enigme", + Lieu lieu_preWarp = new Lieu( + "preWarp", lieu_deposable_1_condition, lieu_depart_1_condition, lieu_fin_1_condition, - lieu_Enigme_1_personnes, - lieu_Enigme_1_descriptions, - lieu_Enigme_1_objets, - lieu_Enigme_1_connaissances + lieu_preWarp_1_personnes, + lieu_preWarp_1_descriptions, + lieu_preWarp_1_objets, + lieu_preWarp_1_connaissances ); - territoire_lieux.add(lieu_Enigme); - List lieu_deposable_2_conditions_ET_list = new ArrayList<>(); + territoire_lieux.add(lieu_preWarp); - List lieu_deposable_2_conditions_TEST_list = new ArrayList<>(); - - lieu_deposable_2_conditions_TEST_list.add( - new ConditionBoolean(false) - ); - lieu_deposable_2_conditions_ET_list.add( - new ConditionEt(lieu_deposable_2_conditions_TEST_list) - ); - - Condition lieu_deposable_2_condition = new Condition(lieu_deposable_2_conditions_ET_list); - List lieu_depart_2_conditions_ET_list = new ArrayList<>(); - - List lieu_depart_2_conditions_TEST_list = new ArrayList<>(); - - lieu_depart_2_conditions_TEST_list.add( - new ConditionBoolean(false) - ); - lieu_depart_2_conditions_ET_list.add( - new ConditionEt(lieu_depart_2_conditions_TEST_list) - ); - - Condition lieu_depart_2_condition = new Condition(lieu_depart_2_conditions_ET_list); - List lieu_fin_2_conditions_ET_list = new ArrayList<>(); - - List lieu_fin_2_conditions_TEST_list = new ArrayList<>(); - - lieu_fin_2_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - lieu_fin_2_conditions_ET_list.add( - new ConditionEt(lieu_fin_2_conditions_TEST_list) - ); - - Condition lieu_fin_2_condition = new Condition(lieu_fin_2_conditions_ET_list); - List lieu_Succes_2_descriptions = new ArrayList<>(); - - List lieu_Succes_2_description_1_conditions_ET_list = new ArrayList<>(); - - List lieu_Succes_2_description_1_conditions_TEST_list = new ArrayList<>(); - - lieu_Succes_2_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - lieu_Succes_2_description_1_conditions_ET_list.add( - new ConditionEt(lieu_Succes_2_description_1_conditions_TEST_list) - ); - - Condition lieu_Succes_2_description_1_condition = new Condition(lieu_Succes_2_description_1_conditions_ET_list); - - lieu_Succes_2_descriptions.add( - new Description( - "lieu succes", - lieu_Succes_2_description_1_condition - ) - ); - - List lieu_Succes_2_personnes = new ArrayList<>(); - List lieu_Succes_2_objets = new ArrayList<>(); - List lieu_Succes_2_connaissances = new ArrayList<>(); + List lieu_postWarp_2_personnes = new ArrayList<>(); + List lieu_postWarp_2_objets = new ArrayList<>(); + List lieu_postWarp_2_connaissances = new ArrayList<>(); // TODO: utiliser un search dans la liste plutot que de déclarer les objets - Lieu lieu_Succes = new Lieu( - "Succes", + Lieu lieu_postWarp = new Lieu( + "postWarp", lieu_deposable_2_condition, lieu_depart_2_condition, lieu_fin_2_condition, - lieu_Succes_2_personnes, - lieu_Succes_2_descriptions, - lieu_Succes_2_objets, - lieu_Succes_2_connaissances + lieu_postWarp_2_personnes, + lieu_postWarp_2_descriptions, + lieu_postWarp_2_objets, + lieu_postWarp_2_connaissances ); - territoire_lieux.add(lieu_Succes); - List lieu_deposable_3_conditions_ET_list = new ArrayList<>(); + territoire_lieux.add(lieu_postWarp); - List lieu_deposable_3_conditions_TEST_list = new ArrayList<>(); - - lieu_deposable_3_conditions_TEST_list.add( - new ConditionBoolean(false) - ); - lieu_deposable_3_conditions_ET_list.add( - new ConditionEt(lieu_deposable_3_conditions_TEST_list) - ); - - Condition lieu_deposable_3_condition = new Condition(lieu_deposable_3_conditions_ET_list); - List lieu_depart_3_conditions_ET_list = new ArrayList<>(); - - List lieu_depart_3_conditions_TEST_list = new ArrayList<>(); - - lieu_depart_3_conditions_TEST_list.add( - new ConditionBoolean(false) - ); - lieu_depart_3_conditions_ET_list.add( - new ConditionEt(lieu_depart_3_conditions_TEST_list) - ); - - Condition lieu_depart_3_condition = new Condition(lieu_depart_3_conditions_ET_list); - List lieu_fin_3_conditions_ET_list = new ArrayList<>(); - - List lieu_fin_3_conditions_TEST_list = new ArrayList<>(); - - lieu_fin_3_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - lieu_fin_3_conditions_ET_list.add( - new ConditionEt(lieu_fin_3_conditions_TEST_list) - ); - - Condition lieu_fin_3_condition = new Condition(lieu_fin_3_conditions_ET_list); - List lieu_Echec_3_descriptions = new ArrayList<>(); - - List lieu_Echec_3_description_1_conditions_ET_list = new ArrayList<>(); - - List lieu_Echec_3_description_1_conditions_TEST_list = new ArrayList<>(); - - lieu_Echec_3_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - lieu_Echec_3_description_1_conditions_ET_list.add( - new ConditionEt(lieu_Echec_3_description_1_conditions_TEST_list) - ); - - Condition lieu_Echec_3_description_1_condition = new Condition(lieu_Echec_3_description_1_conditions_ET_list); - - lieu_Echec_3_descriptions.add( - new Description( - "lieu echec", - lieu_Echec_3_description_1_condition - ) - ); - - List lieu_Echec_3_personnes = new ArrayList<>(); - List lieu_Echec_3_objets = new ArrayList<>(); - List lieu_Echec_3_connaissances = new ArrayList<>(); + List lieu_END_3_personnes = new ArrayList<>(); + List lieu_END_3_objets = new ArrayList<>(); + List lieu_END_3_connaissances = new ArrayList<>(); // TODO: utiliser un search dans la liste plutot que de déclarer les objets - Lieu lieu_Echec = new Lieu( - "Echec", + Lieu lieu_END = new Lieu( + "END", lieu_deposable_3_condition, lieu_depart_3_condition, lieu_fin_3_condition, - lieu_Echec_3_personnes, - lieu_Echec_3_descriptions, - lieu_Echec_3_objets, - lieu_Echec_3_connaissances + lieu_END_3_personnes, + lieu_END_3_descriptions, + lieu_END_3_objets, + lieu_END_3_connaissances ); - territoire_lieux.add(lieu_Echec); + territoire_lieux.add(lieu_END); // "Chemins" List territoire_chemins = new ArrayList<>(); - List chemin_ouvert_Win_1_conditions_ET_list = new ArrayList<>(); - List chemin_ouvert_Win_1_conditions_TEST_list = new ArrayList<>(); - - chemin_ouvert_Win_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - chemin_ouvert_Win_1_conditions_ET_list.add( - new ConditionEt(chemin_ouvert_Win_1_conditions_TEST_list) - ); - - Condition chemin_ouvert_Win_1_condition = new Condition(chemin_ouvert_Win_1_conditions_ET_list); - List chemin_visible_Win_1_conditions_ET_list = new ArrayList<>(); - - List chemin_visible_Win_1_conditions_TEST_list = new ArrayList<>(); - - chemin_visible_Win_1_conditions_TEST_list.add( - new ConditionConnaissance( - connaissance_Reussite, - false - ) - ); - chemin_visible_Win_1_conditions_ET_list.add( - new ConditionEt(chemin_visible_Win_1_conditions_TEST_list) - ); - - Condition chemin_visible_Win_1_condition = new Condition(chemin_visible_Win_1_conditions_ET_list); - List chemin_obligatoire_Win_1_conditions_ET_list = new ArrayList<>(); - - List chemin_obligatoire_Win_1_conditions_TEST_list = new ArrayList<>(); - - chemin_obligatoire_Win_1_conditions_TEST_list.add( - new ConditionBoolean(false) - ); - chemin_obligatoire_Win_1_conditions_ET_list.add( - new ConditionEt(chemin_obligatoire_Win_1_conditions_TEST_list) - ); - - Condition chemin_obligatoire_Win_1_condition = new Condition(chemin_obligatoire_Win_1_conditions_ET_list); - List chemin_Win_1_descriptions = new ArrayList<>(); - - List chemin_Win_1_description_1_conditions_ET_list = new ArrayList<>(); - - List chemin_Win_1_description_1_conditions_TEST_list = new ArrayList<>(); - - chemin_Win_1_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - chemin_Win_1_description_1_conditions_ET_list.add( - new ConditionEt(chemin_Win_1_description_1_conditions_TEST_list) - ); - - Condition chemin_Win_1_description_1_condition = new Condition(chemin_Win_1_description_1_conditions_ET_list); - - chemin_Win_1_descriptions.add( - new Description( - "Le chemin de la victoire !", - chemin_Win_1_description_1_condition - ) - ); - - List chemin_Win_1_connaissances = new ArrayList<>(); - List chemin_Win_1_objets_recus = new ArrayList<>(); - List chemin_Win_1_objets_conso = new ArrayList<>(); + List chemin_Warp_1_connaissances = new ArrayList<>(); + List chemin_Warp_1_objets_recus = new ArrayList<>(); + List chemin_Warp_1_objets_conso = new ArrayList<>(); + chemin_Warp_1_objets_conso.add(objet_warpToken); - Chemin chemins_Win = new Chemin( - "Win", - lieu_Enigme, - lieu_Succes, - chemin_ouvert_Win_1_condition, - chemin_visible_Win_1_condition, - chemin_obligatoire_Win_1_condition, - chemin_Win_1_connaissances, - chemin_Win_1_objets_recus, - chemin_Win_1_objets_conso, - chemin_Win_1_descriptions + Chemin chemins_Warp = new Chemin( + "Warp", + lieu_preWarp, + lieu_postWarp, + chemin_ouvert_Warp_1_condition, + chemin_visible_Warp_1_condition, + chemin_obligatoire_Warp_1_condition, + chemin_Warp_1_connaissances, + chemin_Warp_1_objets_recus, + chemin_Warp_1_objets_conso, + chemin_Warp_1_descriptions ); - territoire_chemins.add(chemins_Win); - List chemin_ouvert_Loose_2_conditions_ET_list = new ArrayList<>(); + territoire_chemins.add(chemins_Warp); - List chemin_ouvert_Loose_2_conditions_TEST_list = new ArrayList<>(); - - chemin_ouvert_Loose_2_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - chemin_ouvert_Loose_2_conditions_ET_list.add( - new ConditionEt(chemin_ouvert_Loose_2_conditions_TEST_list) - ); - - Condition chemin_ouvert_Loose_2_condition = new Condition(chemin_ouvert_Loose_2_conditions_ET_list); - List chemin_visible_Loose_2_conditions_ET_list = new ArrayList<>(); - - List chemin_visible_Loose_2_conditions_TEST_list = new ArrayList<>(); - - chemin_visible_Loose_2_conditions_TEST_list.add( - new ConditionObjet( - objet_tentative, - "==", - 0 - ) - ); - chemin_visible_Loose_2_conditions_ET_list.add( - new ConditionEt(chemin_visible_Loose_2_conditions_TEST_list) - ); - - Condition chemin_visible_Loose_2_condition = new Condition(chemin_visible_Loose_2_conditions_ET_list); - List chemin_obligatoire_Loose_2_conditions_ET_list = new ArrayList<>(); - - List chemin_obligatoire_Loose_2_conditions_TEST_list = new ArrayList<>(); - - chemin_obligatoire_Loose_2_conditions_TEST_list.add( - new ConditionBoolean(false) - ); - chemin_obligatoire_Loose_2_conditions_ET_list.add( - new ConditionEt(chemin_obligatoire_Loose_2_conditions_TEST_list) - ); - - Condition chemin_obligatoire_Loose_2_condition = new Condition(chemin_obligatoire_Loose_2_conditions_ET_list); - List chemin_Loose_2_descriptions = new ArrayList<>(); - - List chemin_Loose_2_description_1_conditions_ET_list = new ArrayList<>(); - - List chemin_Loose_2_description_1_conditions_TEST_list = new ArrayList<>(); - - chemin_Loose_2_description_1_conditions_TEST_list.add( - new ConditionBoolean(true) - ); - chemin_Loose_2_description_1_conditions_ET_list.add( - new ConditionEt(chemin_Loose_2_description_1_conditions_TEST_list) - ); - - Condition chemin_Loose_2_description_1_condition = new Condition(chemin_Loose_2_description_1_conditions_ET_list); - - chemin_Loose_2_descriptions.add( - new Description( - "Le chemin de la loose !", - chemin_Loose_2_description_1_condition - ) - ); - - List chemin_Loose_2_connaissances = new ArrayList<>(); - List chemin_Loose_2_objets_recus = new ArrayList<>(); - List chemin_Loose_2_objets_conso = new ArrayList<>(); + List chemin_EndChemin_2_connaissances = new ArrayList<>(); + List chemin_EndChemin_2_objets_recus = new ArrayList<>(); + List chemin_EndChemin_2_objets_conso = new ArrayList<>(); - Chemin chemins_Loose = new Chemin( - "Loose", - lieu_Enigme, - lieu_Echec, - chemin_ouvert_Loose_2_condition, - chemin_visible_Loose_2_condition, - chemin_obligatoire_Loose_2_condition, - chemin_Loose_2_connaissances, - chemin_Loose_2_objets_recus, - chemin_Loose_2_objets_conso, - chemin_Loose_2_descriptions + Chemin chemins_EndChemin = new Chemin( + "EndChemin", + lieu_postWarp, + lieu_END, + chemin_ouvert_EndChemin_2_condition, + chemin_visible_EndChemin_2_condition, + chemin_obligatoire_EndChemin_2_condition, + chemin_EndChemin_2_connaissances, + chemin_EndChemin_2_objets_recus, + chemin_EndChemin_2_objets_conso, + chemin_EndChemin_2_descriptions ); - territoire_chemins.add(chemins_Loose); + territoire_chemins.add(chemins_EndChemin); Territoire jeu_territoire = new Territoire(territoire_lieux, territoire_chemins); diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Prototype.java.bak b/runtime-workspace/fr.n7.game.examples/src-gen/Prototype.java.bak new file mode 100644 index 0000000..9fc13bf --- /dev/null +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Prototype.java.bak @@ -0,0 +1,666 @@ +import java.util.List; +import java.util.Map; +import java.util.ArrayList; +import java.util.HashMap; +import java.io.InputStreamReader; +import java.io.BufferedReader; +import java.io.IOException; + +public class Prototype { + public static void main(String[] args) { + + // "Objets" + + List jeu_objets = new ArrayList<>(); + Map jeu_objets2 = new HashMap<>(); + + List objet_warpToken_descriptions = new ArrayList<>(); + + objet_warpToken_descriptions.add( + new Description( + "warpToken description", + new Condition(null))); + + + Objet objet_warpToken = new Objet( + "warpToken", + 1, + objet_visible_warpToken_condition, + objet_warpToken_descriptions); + jeu_objets2.put("test", objet_warpToken); + + List objet_warpTicket_descriptions = new ArrayList<>(); + + List objet_warpTicket_description_1_conditions_ET_list = new ArrayList<>(); + + List objet_warpTicket_description_1_conditions_TEST_list = new ArrayList<>(); + + objet_warpTicket_description_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + objet_warpTicket_description_1_conditions_ET_list.add( + new ConditionEt(objet_warpTicket_description_1_conditions_TEST_list)); + + Condition objet_warpTicket_description_1_condition = new Condition( + objet_warpTicket_description_1_conditions_ET_list); + + objet_warpTicket_descriptions.add( + new Description( + "warpTicket description", + objet_warpTicket_description_1_condition)); + List objet_visible_warpTicket_conditions_ET_list = new ArrayList<>(); + + List objet_visible_warpTicket_conditions_TEST_list = new ArrayList<>(); + + objet_visible_warpTicket_conditions_TEST_list.add( + new ConditionBoolean(true)); + objet_visible_warpTicket_conditions_ET_list.add( + new ConditionEt(objet_visible_warpTicket_conditions_TEST_list)); + + Condition objet_visible_warpTicket_condition = new Condition(objet_visible_warpTicket_conditions_ET_list); + Objet objet_warpTicket = new Objet( + "warpTicket", + 1, + objet_visible_warpTicket_condition, + objet_warpTicket_descriptions); + jeu_objets.add(objet_warpTicket); + List objet_warpReceipt_descriptions = new ArrayList<>(); + + List objet_warpReceipt_description_1_conditions_ET_list = new ArrayList<>(); + + List objet_warpReceipt_description_1_conditions_TEST_list = new ArrayList<>(); + + objet_warpReceipt_description_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + objet_warpReceipt_description_1_conditions_ET_list.add( + new ConditionEt(objet_warpReceipt_description_1_conditions_TEST_list)); + + Condition objet_warpReceipt_description_1_condition = new Condition( + objet_warpReceipt_description_1_conditions_ET_list); + + objet_warpReceipt_descriptions.add( + new Description( + "warpReceipt description", + objet_warpReceipt_description_1_condition)); + List objet_visible_warpReceipt_conditions_ET_list = new ArrayList<>(); + + List objet_visible_warpReceipt_conditions_TEST_list = new ArrayList<>(); + + objet_visible_warpReceipt_conditions_TEST_list.add( + new ConditionBoolean(true)); + objet_visible_warpReceipt_conditions_ET_list.add( + new ConditionEt(objet_visible_warpReceipt_conditions_TEST_list)); + + Condition objet_visible_warpReceipt_condition = new Condition(objet_visible_warpReceipt_conditions_ET_list); + Objet objet_warpReceipt = new Objet( + "warpReceipt", + 1, + objet_visible_warpReceipt_condition, + objet_warpReceipt_descriptions); + jeu_objets.add(objet_warpReceipt); + + // "Connaissances" + + List jeu_connaissances = new ArrayList<>(); + + // "Transformations" + + List jeu_transformations = new ArrayList<>(); + + // "Explorateur" + + List explorateur_inventaire = new ArrayList<>(); + explorateur_inventaire.add(objet_warpTicket); + + List explorateur_connaissances = new ArrayList<>(); + + Jeu.explorateur = new Explorateur( + 5, + explorateur_connaissances, + explorateur_inventaire); + + // "Personnes" + + List jeu_personnes = new ArrayList<>(); + + List personne_visible_cashier_1_conditions_ET_list = new ArrayList<>(); + + List personne_visible_cashier_1_conditions_TEST_list = new ArrayList<>(); + + personne_visible_cashier_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + personne_visible_cashier_1_conditions_ET_list.add( + new ConditionEt(personne_visible_cashier_1_conditions_TEST_list)); + + Condition personne_visible_cashier_1_condition = new Condition(personne_visible_cashier_1_conditions_ET_list); + List personne_obligatoire_cashier_1_conditions_ET_list = new ArrayList<>(); + + List personne_obligatoire_cashier_1_conditions_TEST_list = new ArrayList<>(); + + personne_obligatoire_cashier_1_conditions_TEST_list.add( + new ConditionBoolean(false)); + personne_obligatoire_cashier_1_conditions_ET_list.add( + new ConditionEt(personne_obligatoire_cashier_1_conditions_TEST_list)); + + Condition personne_obligatoire_cashier_1_condition = new Condition( + personne_obligatoire_cashier_1_conditions_ET_list); + List personne_cashier_1_interactions = new ArrayList<>(); + + List personne_cashier_1_interaction_visible_1_conditions_ET_list = new ArrayList<>(); + + List personne_cashier_1_interaction_visible_1_conditions_TEST_list = new ArrayList<>(); + + personne_cashier_1_interaction_visible_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + personne_cashier_1_interaction_visible_1_conditions_ET_list.add( + new ConditionEt(personne_cashier_1_interaction_visible_1_conditions_TEST_list)); + + Condition personne_cashier_1_interaction_visible_1_condition = new Condition( + personne_cashier_1_interaction_visible_1_conditions_ET_list); + List personne_cashier_1_interaction_1_actions = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_visible_1_conditions_ET_list = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_visible_1_conditions_TEST_list = new ArrayList<>(); + + personne_cashier_1_interaction_1_action_visible_1_conditions_TEST_list.add( + new ConditionObjet( + objet_warpTicket, + "==", + 1)); + personne_cashier_1_interaction_1_action_visible_1_conditions_ET_list.add( + new ConditionEt(personne_cashier_1_interaction_1_action_visible_1_conditions_TEST_list)); + + Condition personne_cashier_1_interaction_1_action_visible_1_condition = new Condition( + personne_cashier_1_interaction_1_action_visible_1_conditions_ET_list); + List personne_cashier_1_interaction_1_action_fin_1_conditions_ET_list = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_fin_1_conditions_TEST_list = new ArrayList<>(); + + personne_cashier_1_interaction_1_action_fin_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + personne_cashier_1_interaction_1_action_fin_1_conditions_ET_list.add( + new ConditionEt(personne_cashier_1_interaction_1_action_fin_1_conditions_TEST_list)); + + Condition personne_cashier_1_interaction_1_action_fin_1_condition = new Condition( + personne_cashier_1_interaction_1_action_fin_1_conditions_ET_list); + List personne_cashier_1_interaction_1_action_1_descriptions = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_1_description_1_conditions_ET_list = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_1_description_1_conditions_TEST_list = new ArrayList<>(); + + personne_cashier_1_interaction_1_action_1_description_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + personne_cashier_1_interaction_1_action_1_description_1_conditions_ET_list.add( + new ConditionEt(personne_cashier_1_interaction_1_action_1_description_1_conditions_TEST_list)); + + Condition personne_cashier_1_interaction_1_action_1_description_1_condition = new Condition( + personne_cashier_1_interaction_1_action_1_description_1_conditions_ET_list); + + personne_cashier_1_interaction_1_action_1_descriptions.add( + new Description( + "Acheter un ticket", + personne_cashier_1_interaction_1_action_1_description_1_condition)); + + List personne_cashier_1_interaction_1_action_1_connaissances = new ArrayList<>(); + List personne_cashier_1_interaction_1_action_1_objets_conso = new ArrayList<>(); + personne_cashier_1_interaction_1_action_1_objets_conso.add(objet_warpTicket); + List personne_cashier_1_interaction_1_action_1_objets_recus = new ArrayList<>(); + personne_cashier_1_interaction_1_action_1_objets_recus.add(objet_warpToken); + personne_cashier_1_interaction_1_action_1_objets_recus.add(objet_warpReceipt); + + personne_cashier_1_interaction_1_actions.add( + new Action( + personne_cashier_1_interaction_1_action_visible_1_condition, + personne_cashier_1_interaction_1_action_fin_1_condition, + personne_cashier_1_interaction_1_action_1_connaissances, + personne_cashier_1_interaction_1_action_1_objets_recus, + personne_cashier_1_interaction_1_action_1_objets_conso, + personne_cashier_1_interaction_1_action_1_descriptions)); + List personne_cashier_1_interaction_1_action_visible_2_conditions_ET_list = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_visible_2_conditions_TEST_list = new ArrayList<>(); + + personne_cashier_1_interaction_1_action_visible_2_conditions_TEST_list.add( + new ConditionBoolean(true)); + personne_cashier_1_interaction_1_action_visible_2_conditions_ET_list.add( + new ConditionEt(personne_cashier_1_interaction_1_action_visible_2_conditions_TEST_list)); + + Condition personne_cashier_1_interaction_1_action_visible_2_condition = new Condition( + personne_cashier_1_interaction_1_action_visible_2_conditions_ET_list); + List personne_cashier_1_interaction_1_action_fin_2_conditions_ET_list = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_fin_2_conditions_TEST_list = new ArrayList<>(); + + personne_cashier_1_interaction_1_action_fin_2_conditions_TEST_list.add( + new ConditionBoolean(true)); + personne_cashier_1_interaction_1_action_fin_2_conditions_ET_list.add( + new ConditionEt(personne_cashier_1_interaction_1_action_fin_2_conditions_TEST_list)); + + Condition personne_cashier_1_interaction_1_action_fin_2_condition = new Condition( + personne_cashier_1_interaction_1_action_fin_2_conditions_ET_list); + List personne_cashier_1_interaction_1_action_2_descriptions = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_2_description_1_conditions_ET_list = new ArrayList<>(); + + List personne_cashier_1_interaction_1_action_2_description_1_conditions_TEST_list = new ArrayList<>(); + + personne_cashier_1_interaction_1_action_2_description_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + personne_cashier_1_interaction_1_action_2_description_1_conditions_ET_list.add( + new ConditionEt(personne_cashier_1_interaction_1_action_2_description_1_conditions_TEST_list)); + + Condition personne_cashier_1_interaction_1_action_2_description_1_condition = new Condition( + personne_cashier_1_interaction_1_action_2_description_1_conditions_ET_list); + + personne_cashier_1_interaction_1_action_2_descriptions.add( + new Description( + "Quitter", + personne_cashier_1_interaction_1_action_2_description_1_condition)); + + List personne_cashier_1_interaction_1_action_2_connaissances = new ArrayList<>(); + List personne_cashier_1_interaction_1_action_2_objets_conso = new ArrayList<>(); + List personne_cashier_1_interaction_1_action_2_objets_recus = new ArrayList<>(); + + personne_cashier_1_interaction_1_actions.add( + new Action( + personne_cashier_1_interaction_1_action_visible_2_condition, + personne_cashier_1_interaction_1_action_fin_2_condition, + personne_cashier_1_interaction_1_action_2_connaissances, + personne_cashier_1_interaction_1_action_2_objets_recus, + personne_cashier_1_interaction_1_action_2_objets_conso, + personne_cashier_1_interaction_1_action_2_descriptions)); + + List personne_cashier_1_interaction_1_connaissances = new ArrayList<>(); + List personne_cashier_1_interaction_1_objets_conso = new ArrayList<>(); + List personne_cashier_1_interaction_1_objets_recus = new ArrayList<>(); + + personne_cashier_1_interactions.add( + new Interaction( + personne_cashier_1_interaction_visible_1_condition, + personne_cashier_1_interaction_1_connaissances, + personne_cashier_1_interaction_1_objets_conso, + personne_cashier_1_interaction_1_objets_recus, + personne_cashier_1_interaction_1_actions)); + + Personne personne_cashier = new Personne( + "cashier", + personne_visible_cashier_1_condition, + personne_obligatoire_cashier_1_condition, + personne_cashier_1_interactions); + + jeu_personnes.add(personne_cashier); + + // "Lieux" + + List territoire_lieux = new ArrayList<>(); + List lieu_deposable_1_conditions_ET_list = new ArrayList<>(); + + List lieu_deposable_1_conditions_TEST_list = new ArrayList<>(); + + lieu_deposable_1_conditions_TEST_list.add( + new ConditionBoolean(false)); + lieu_deposable_1_conditions_ET_list.add( + new ConditionEt(lieu_deposable_1_conditions_TEST_list)); + + Condition lieu_deposable_1_condition = new Condition(lieu_deposable_1_conditions_ET_list); + List lieu_depart_1_conditions_ET_list = new ArrayList<>(); + + List lieu_depart_1_conditions_TEST_list = new ArrayList<>(); + + lieu_depart_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + lieu_depart_1_conditions_ET_list.add( + new ConditionEt(lieu_depart_1_conditions_TEST_list)); + + Condition lieu_depart_1_condition = new Condition(lieu_depart_1_conditions_ET_list); + List lieu_fin_1_conditions_ET_list = new ArrayList<>(); + + List lieu_fin_1_conditions_TEST_list = new ArrayList<>(); + + lieu_fin_1_conditions_TEST_list.add( + new ConditionBoolean(false)); + lieu_fin_1_conditions_ET_list.add( + new ConditionEt(lieu_fin_1_conditions_TEST_list)); + + Condition lieu_fin_1_condition = new Condition(lieu_fin_1_conditions_ET_list); + List lieu_preWarp_1_descriptions = new ArrayList<>(); + + List lieu_preWarp_1_description_1_conditions_ET_list = new ArrayList<>(); + + List lieu_preWarp_1_description_1_conditions_TEST_list = new ArrayList<>(); + + lieu_preWarp_1_description_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + lieu_preWarp_1_description_1_conditions_ET_list.add( + new ConditionEt(lieu_preWarp_1_description_1_conditions_TEST_list)); + + Condition lieu_preWarp_1_description_1_condition = new Condition( + lieu_preWarp_1_description_1_conditions_ET_list); + + lieu_preWarp_1_descriptions.add( + new Description( + "preWarp description", + lieu_preWarp_1_description_1_condition)); + + List lieu_preWarp_1_personnes = new ArrayList<>(); + lieu_preWarp_1_personnes.add(personne_cashier); + List lieu_preWarp_1_objets = new ArrayList<>(); + List lieu_preWarp_1_connaissances = new ArrayList<>(); + + // TODO: utiliser un search dans la liste plutot que de déclarer les objets + Lieu lieu_preWarp = new Lieu( + "preWarp", + lieu_deposable_1_condition, + lieu_depart_1_condition, + lieu_fin_1_condition, + lieu_preWarp_1_personnes, + lieu_preWarp_1_descriptions, + lieu_preWarp_1_objets, + lieu_preWarp_1_connaissances); + + territoire_lieux.add(lieu_preWarp); + List lieu_deposable_2_conditions_ET_list = new ArrayList<>(); + + List lieu_deposable_2_conditions_TEST_list = new ArrayList<>(); + + lieu_deposable_2_conditions_TEST_list.add( + new ConditionBoolean(true)); + lieu_deposable_2_conditions_ET_list.add( + new ConditionEt(lieu_deposable_2_conditions_TEST_list)); + + Condition lieu_deposable_2_condition = new Condition(lieu_deposable_2_conditions_ET_list); + List lieu_depart_2_conditions_ET_list = new ArrayList<>(); + + List lieu_depart_2_conditions_TEST_list = new ArrayList<>(); + + lieu_depart_2_conditions_TEST_list.add( + new ConditionBoolean(false)); + lieu_depart_2_conditions_ET_list.add( + new ConditionEt(lieu_depart_2_conditions_TEST_list)); + + Condition lieu_depart_2_condition = new Condition(lieu_depart_2_conditions_ET_list); + List lieu_fin_2_conditions_ET_list = new ArrayList<>(); + + List lieu_fin_2_conditions_TEST_list = new ArrayList<>(); + + lieu_fin_2_conditions_TEST_list.add( + new ConditionBoolean(false)); + lieu_fin_2_conditions_ET_list.add( + new ConditionEt(lieu_fin_2_conditions_TEST_list)); + + Condition lieu_fin_2_condition = new Condition(lieu_fin_2_conditions_ET_list); + List lieu_postWarp_2_descriptions = new ArrayList<>(); + + List lieu_postWarp_2_description_1_conditions_ET_list = new ArrayList<>(); + + List lieu_postWarp_2_description_1_conditions_TEST_list = new ArrayList<>(); + + lieu_postWarp_2_description_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + lieu_postWarp_2_description_1_conditions_ET_list.add( + new ConditionEt(lieu_postWarp_2_description_1_conditions_TEST_list)); + + Condition lieu_postWarp_2_description_1_condition = new Condition( + lieu_postWarp_2_description_1_conditions_ET_list); + + lieu_postWarp_2_descriptions.add( + new Description( + "postWarp description", + lieu_postWarp_2_description_1_condition)); + + List lieu_postWarp_2_personnes = new ArrayList<>(); + List lieu_postWarp_2_objets = new ArrayList<>(); + List lieu_postWarp_2_connaissances = new ArrayList<>(); + + // TODO: utiliser un search dans la liste plutot que de déclarer les objets + Lieu lieu_postWarp = new Lieu( + "postWarp", + lieu_deposable_2_condition, + lieu_depart_2_condition, + lieu_fin_2_condition, + lieu_postWarp_2_personnes, + lieu_postWarp_2_descriptions, + lieu_postWarp_2_objets, + lieu_postWarp_2_connaissances); + + territoire_lieux.add(lieu_postWarp); + List lieu_deposable_3_conditions_ET_list = new ArrayList<>(); + + List lieu_deposable_3_conditions_TEST_list = new ArrayList<>(); + + lieu_deposable_3_conditions_TEST_list.add( + new ConditionBoolean(false)); + lieu_deposable_3_conditions_ET_list.add( + new ConditionEt(lieu_deposable_3_conditions_TEST_list)); + + Condition lieu_deposable_3_condition = new Condition(lieu_deposable_3_conditions_ET_list); + List lieu_depart_3_conditions_ET_list = new ArrayList<>(); + + List lieu_depart_3_conditions_TEST_list = new ArrayList<>(); + + lieu_depart_3_conditions_TEST_list.add( + new ConditionBoolean(false)); + lieu_depart_3_conditions_ET_list.add( + new ConditionEt(lieu_depart_3_conditions_TEST_list)); + + Condition lieu_depart_3_condition = new Condition(lieu_depart_3_conditions_ET_list); + List lieu_fin_3_conditions_ET_list = new ArrayList<>(); + + List lieu_fin_3_conditions_TEST_list = new ArrayList<>(); + + lieu_fin_3_conditions_TEST_list.add( + new ConditionBoolean(true)); + lieu_fin_3_conditions_ET_list.add( + new ConditionEt(lieu_fin_3_conditions_TEST_list)); + + Condition lieu_fin_3_condition = new Condition(lieu_fin_3_conditions_ET_list); + List lieu_END_3_descriptions = new ArrayList<>(); + + List lieu_END_3_description_1_conditions_ET_list = new ArrayList<>(); + + List lieu_END_3_description_1_conditions_TEST_list = new ArrayList<>(); + + lieu_END_3_description_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + lieu_END_3_description_1_conditions_ET_list.add( + new ConditionEt(lieu_END_3_description_1_conditions_TEST_list)); + + Condition lieu_END_3_description_1_condition = new Condition(lieu_END_3_description_1_conditions_ET_list); + + lieu_END_3_descriptions.add( + new Description( + "END description", + lieu_END_3_description_1_condition)); + + List lieu_END_3_personnes = new ArrayList<>(); + List lieu_END_3_objets = new ArrayList<>(); + List lieu_END_3_connaissances = new ArrayList<>(); + + // TODO: utiliser un search dans la liste plutot que de déclarer les objets + Lieu lieu_END = new Lieu( + "END", + lieu_deposable_3_condition, + lieu_depart_3_condition, + lieu_fin_3_condition, + lieu_END_3_personnes, + lieu_END_3_descriptions, + lieu_END_3_objets, + lieu_END_3_connaissances); + + territoire_lieux.add(lieu_END); + + // "Chemins" + + List territoire_chemins = new ArrayList<>(); + List chemin_ouvert_Warp_1_conditions_ET_list = new ArrayList<>(); + + List chemin_ouvert_Warp_1_conditions_TEST_list = new ArrayList<>(); + + chemin_ouvert_Warp_1_conditions_TEST_list.add( + new ConditionObjet( + objet_warpToken, + ">", + 0)); + chemin_ouvert_Warp_1_conditions_ET_list.add( + new ConditionEt(chemin_ouvert_Warp_1_conditions_TEST_list)); + + Condition chemin_ouvert_Warp_1_condition = new Condition(chemin_ouvert_Warp_1_conditions_ET_list); + List chemin_visible_Warp_1_conditions_ET_list = new ArrayList<>(); + + List chemin_visible_Warp_1_conditions_TEST_list = new ArrayList<>(); + + chemin_visible_Warp_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + chemin_visible_Warp_1_conditions_ET_list.add( + new ConditionEt(chemin_visible_Warp_1_conditions_TEST_list)); + + Condition chemin_visible_Warp_1_condition = new Condition(chemin_visible_Warp_1_conditions_ET_list); + List chemin_obligatoire_Warp_1_conditions_ET_list = new ArrayList<>(); + + List chemin_obligatoire_Warp_1_conditions_TEST_list = new ArrayList<>(); + + chemin_obligatoire_Warp_1_conditions_TEST_list.add( + new ConditionBoolean(false)); + chemin_obligatoire_Warp_1_conditions_ET_list.add( + new ConditionEt(chemin_obligatoire_Warp_1_conditions_TEST_list)); + + Condition chemin_obligatoire_Warp_1_condition = new Condition(chemin_obligatoire_Warp_1_conditions_ET_list); + List chemin_Warp_1_descriptions = new ArrayList<>(); + + List chemin_Warp_1_description_1_conditions_ET_list = new ArrayList<>(); + + List chemin_Warp_1_description_1_conditions_TEST_list = new ArrayList<>(); + + chemin_Warp_1_description_1_conditions_TEST_list.add( + new ConditionObjet( + objet_warpToken, + "==", + 0)); + chemin_Warp_1_description_1_conditions_ET_list.add( + new ConditionEt(chemin_Warp_1_description_1_conditions_TEST_list)); + + Condition chemin_Warp_1_description_1_condition = new Condition(chemin_Warp_1_description_1_conditions_ET_list); + + chemin_Warp_1_descriptions.add( + new Description( + "Warp description (need token)", + chemin_Warp_1_description_1_condition)); + List chemin_Warp_1_description_2_conditions_ET_list = new ArrayList<>(); + + List chemin_Warp_1_description_2_conditions_TEST_list = new ArrayList<>(); + + chemin_Warp_1_description_2_conditions_TEST_list.add( + new ConditionObjet( + objet_warpToken, + "==", + 1)); + chemin_Warp_1_description_2_conditions_ET_list.add( + new ConditionEt(chemin_Warp_1_description_2_conditions_TEST_list)); + + Condition chemin_Warp_1_description_2_condition = new Condition(chemin_Warp_1_description_2_conditions_ET_list); + + chemin_Warp_1_descriptions.add( + new Description( + "Warp description (token acquired)", + chemin_Warp_1_description_2_condition)); + + List chemin_Warp_1_connaissances = new ArrayList<>(); + List chemin_Warp_1_objets_recus = new ArrayList<>(); + List chemin_Warp_1_objets_conso = new ArrayList<>(); + chemin_Warp_1_objets_conso.add(objet_warpToken); + + Chemin chemins_Warp = new Chemin( + "Warp", + lieu_preWarp, + lieu_postWarp, + chemin_ouvert_Warp_1_condition, + chemin_visible_Warp_1_condition, + chemin_obligatoire_Warp_1_condition, + chemin_Warp_1_connaissances, + chemin_Warp_1_objets_recus, + chemin_Warp_1_objets_conso, + chemin_Warp_1_descriptions); + + territoire_chemins.add(chemins_Warp); + List chemin_ouvert_EndChemin_2_conditions_ET_list = new ArrayList<>(); + + List chemin_ouvert_EndChemin_2_conditions_TEST_list = new ArrayList<>(); + + chemin_ouvert_EndChemin_2_conditions_TEST_list.add( + new ConditionBoolean(true)); + chemin_ouvert_EndChemin_2_conditions_ET_list.add( + new ConditionEt(chemin_ouvert_EndChemin_2_conditions_TEST_list)); + + Condition chemin_ouvert_EndChemin_2_condition = new Condition(chemin_ouvert_EndChemin_2_conditions_ET_list); + List chemin_visible_EndChemin_2_conditions_ET_list = new ArrayList<>(); + + List chemin_visible_EndChemin_2_conditions_TEST_list = new ArrayList<>(); + + chemin_visible_EndChemin_2_conditions_TEST_list.add( + new ConditionBoolean(true)); + chemin_visible_EndChemin_2_conditions_ET_list.add( + new ConditionEt(chemin_visible_EndChemin_2_conditions_TEST_list)); + + Condition chemin_visible_EndChemin_2_condition = new Condition(chemin_visible_EndChemin_2_conditions_ET_list); + List chemin_obligatoire_EndChemin_2_conditions_ET_list = new ArrayList<>(); + + List chemin_obligatoire_EndChemin_2_conditions_TEST_list = new ArrayList<>(); + + chemin_obligatoire_EndChemin_2_conditions_TEST_list.add( + new ConditionBoolean(false)); + chemin_obligatoire_EndChemin_2_conditions_ET_list.add( + new ConditionEt(chemin_obligatoire_EndChemin_2_conditions_TEST_list)); + + Condition chemin_obligatoire_EndChemin_2_condition = new Condition( + chemin_obligatoire_EndChemin_2_conditions_ET_list); + List chemin_EndChemin_2_descriptions = new ArrayList<>(); + + List chemin_EndChemin_2_description_1_conditions_ET_list = new ArrayList<>(); + + List chemin_EndChemin_2_description_1_conditions_TEST_list = new ArrayList<>(); + + chemin_EndChemin_2_description_1_conditions_TEST_list.add( + new ConditionBoolean(true)); + chemin_EndChemin_2_description_1_conditions_ET_list.add( + new ConditionEt(chemin_EndChemin_2_description_1_conditions_TEST_list)); + + Condition chemin_EndChemin_2_description_1_condition = new Condition( + chemin_EndChemin_2_description_1_conditions_ET_list); + + chemin_EndChemin_2_descriptions.add( + new Description( + "END description", + chemin_EndChemin_2_description_1_condition)); + + List chemin_EndChemin_2_connaissances = new ArrayList<>(); + List chemin_EndChemin_2_objets_recus = new ArrayList<>(); + List chemin_EndChemin_2_objets_conso = new ArrayList<>(); + + Chemin chemins_EndChemin = new Chemin( + "EndChemin", + lieu_postWarp, + lieu_END, + chemin_ouvert_EndChemin_2_condition, + chemin_visible_EndChemin_2_condition, + chemin_obligatoire_EndChemin_2_condition, + chemin_EndChemin_2_connaissances, + chemin_EndChemin_2_objets_recus, + chemin_EndChemin_2_objets_conso, + chemin_EndChemin_2_descriptions); + + territoire_chemins.add(chemins_EndChemin); + + Territoire jeu_territoire = new Territoire(territoire_lieux, territoire_chemins); + + Jeu ze_GAME = new Jeu( + jeu_territoire, + jeu_objets, + jeu_connaissances, + jeu_personnes, + jeu_transformations); + + ze_GAME.jouer(); + + } +} diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Tamerelapute.java b/runtime-workspace/fr.n7.game.examples/src-gen/Tamerelapute.java new file mode 100644 index 0000000..f19adf3 --- /dev/null +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Tamerelapute.java @@ -0,0 +1,42 @@ +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import static java.util.Map.entry; + +public class Tamerelapute { + public static void main(String[] args) { + + Condition test = new Condition( + List.of( + List.of( + new ConditionBoolean(false), + new ConditionBoolean(true)), + List.of( + new ConditionBoolean(true)))); + + System.out.println(test.evaluer()); + + Map test2 = Map.ofEntries( + entry( + "warpToken", + new Objet( + "warpToken", + 1, + test, + List.of(new Description("test", "prout", test)))), + entry( + "warpToken2", + new Objet( + "warpToken2", + 2, + test, + List.of(new Description("prout", test))))); + + System.out.println(test2); + + System.out.println(test2.get("warpToken")); + + } +} diff --git a/runtime-workspace/fr.n7.game.examples/src-gen/Transformation.java b/runtime-workspace/fr.n7.game.examples/src-gen/Transformation.java index e4b2aeb..3caceb0 100644 --- a/runtime-workspace/fr.n7.game.examples/src-gen/Transformation.java +++ b/runtime-workspace/fr.n7.game.examples/src-gen/Transformation.java @@ -1,14 +1,17 @@ import java.util.List; public class Transformation { + String nom; Condition possible; List objetsSources; List objetsResultats; public Transformation( + String nom, Condition possible, List objetsSources, List objetsResultats) { + this.nom = nom; this.possible = possible; this.objetsSources = objetsSources; this.objetsResultats = objetsResultats; diff --git a/runtime-workspace/fr.n7.game.examples/test2.game b/runtime-workspace/fr.n7.game.examples/test2.game index 177d774..804b208 100644 --- a/runtime-workspace/fr.n7.game.examples/test2.game +++ b/runtime-workspace/fr.n7.game.examples/test2.game @@ -15,7 +15,6 @@ Explorateur: taille: 1 connaissances: objets: - - warpToken Personnes: @@ -61,7 +60,7 @@ Territoire: - Warp: lieu_in: preWarp lieu_out: postWarp - ouvert: true + ouvert: warpToken > 0 visible: true obligatoire: false connaissances: @@ -70,10 +69,10 @@ Territoire: - warpToken descriptions: - DescriptionToken: - texte: "preWarp description (need token)" + texte: "Warp description (need token)" condition: warpToken == 0 - DescriptionNoToken: - texte: "preWarp description (token acquired)" + texte: "Warp description (token acquired)" condition: warpToken == 1 - EndChemin: diff --git a/runtime-workspace/fr.n7.game.examples/test3.game b/runtime-workspace/fr.n7.game.examples/test3.game new file mode 100644 index 0000000..e0d42a9 --- /dev/null +++ b/runtime-workspace/fr.n7.game.examples/test3.game @@ -0,0 +1,140 @@ +Objets: + - warpToken: + taille: 1 + visible: true && true && true || true && false || false + descriptions: + - Description1: + texte: "warpToken description" + condition: true + + - warpTicket: + taille: 1 + visible: true + descriptions: + - Description1: + texte: "warpTicket description" + condition: true + + - warpReceipt: + taille: 1 + visible: true + descriptions: + - Description1: + texte: "warpReceipt description" + condition: true + +Transformations: + +Connaissances: + +Explorateur: + taille: 5 + connaissances: + objets: + - warpTicket +Personnes: + - cashier: + visible: true + obligatoire: false + interactions: + - Parler: + visible: true + connaissances: + objets_recus: + objets_conso: + actions: + - Acheter: + visible: warpTicket == 1 + fin_interaction: true + connaissances: + objets_recus: + - warpToken + - warpReceipt + objets_conso: + - warpTicket + descriptions: + - Description1: + texte: "Acheter un ticket" + condition: true + - Quitter: + visible: true + fin_interaction: true + connaissances: + objets_recus: + objets_conso: + descriptions: + - Description1: + texte: "Quitter" + condition: true + +Territoire: + Lieux: + - preWarp: + deposable: false + depart: true + fin: false + personnes: + - cashier + descriptions: + - Description1: + texte: "preWarp description" + condition: true + objets: + connaissances: + + - postWarp: + deposable: true + depart: false + fin: false + personnes: + descriptions: + - Description1: + texte: "postWarp description" + condition: true + objets: + connaissances: + + - END: + deposable: false + depart: false + fin: true + personnes: + descriptions: + - Description1: + texte: "END description" + condition: true + objets: + connaissances: + + Chemins: + - Warp: + lieu_in: preWarp + lieu_out: postWarp + ouvert: warpToken > 0 + visible: true + obligatoire: false + connaissances: + objets_recus: + objets_conso: + - warpToken + descriptions: + - DescriptionToken: + texte: "Warp description (need token)" + condition: warpToken == 0 + - DescriptionNoToken: + texte: "Warp description (token acquired)" + condition: warpToken == 1 + + - EndChemin: + lieu_in: postWarp + lieu_out: END + ouvert: true + visible: true + obligatoire: false + connaissances: + objets_recus: + objets_conso: + descriptions: + - DescriptionToken: + texte: "END description" + condition: true diff --git a/workspace/fr.n7.game.toPrototype/bin/fr/n7/game/toPrototype/main/toPrototype.emtl b/workspace/fr.n7.game.toPrototype/bin/fr/n7/game/toPrototype/main/toPrototype.emtl index af4b58a..93d73d8 100644 --- a/workspace/fr.n7.game.toPrototype/bin/fr/n7/game/toPrototype/main/toPrototype.emtl +++ b/workspace/fr.n7.game.toPrototype/bin/fr/n7/game/toPrototype/main/toPrototype.emtl @@ -6,7 +6,7 @@ - + @@ -14,32 +14,33 @@ - + - - + + - - - - - - - - - - - - - - - - - - - + + + + - + + + + + + + + + + + + + + + + + @@ -49,69 +50,39 @@ - - - - + + + + + + + - - - - - - - + - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -122,33 +93,26 @@ - - + + - - + + - - - - - - - - - - - - - - - - - - - + + + + - + + + + + + + + + @@ -158,61 +122,39 @@ - - - - + + + + + + + - - - - - - - + - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -223,10 +165,26 @@ - - + + - + + + + + + + + + + + + + + + + + @@ -236,40 +194,40 @@ - - - - - - - - - - - - - - - - - - + - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + @@ -279,26 +237,39 @@ - - - - - + - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + @@ -308,19 +279,28 @@ - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + @@ -331,35 +311,22 @@ - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - + + + - + - + @@ -367,7 +334,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -382,22 +374,76 @@ - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -407,37 +453,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -447,37 +464,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -486,97 +474,29 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - + + + + + + - + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -587,10 +507,26 @@ - - + + - + + + + + + + + + + + + + + + + + @@ -600,21 +536,8 @@ - - - - - - - - - - - - - - + @@ -624,21 +547,8 @@ - - - - - - - - - - - - - - + @@ -648,94 +558,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + @@ -746,41 +601,48 @@ - - + + - - - - - - - - - - - - - - + - - - - - - - + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + @@ -791,41 +653,38 @@ - - - - - - - - - - - - - + - + - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + @@ -836,91 +695,32 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -935,240 +735,127 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - + - - - - - - - - - - - - - + @@ -1176,196 +863,117 @@ - + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - + - + - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - + + - - - + + - - - - - - - + + + + + + + - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -1379,7 +987,9 @@ - + + + @@ -1392,29 +1002,16 @@ - - - - - + - - - - - + - - - - - - + - + @@ -1424,10 +1021,10 @@ - + - + @@ -1436,32 +1033,36 @@ - + - + - + - - + + + + + + - + - + - + @@ -1475,15 +1076,15 @@ - + - + - + @@ -1492,10 +1093,10 @@ - + - + @@ -1503,39 +1104,43 @@ - + - - + + + + + + - + - + - + - + - + - + - + - + @@ -1544,36 +1149,69 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + - - - - - + @@ -1584,632 +1222,442 @@ - - - - - - - - - + - - - - + - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + - - + + + + + + + + + - - - + + + + + + + + + + + + + + + - + + - - - - + - - - - - + - + - + - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + - - - - - + - + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + - - - - - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + - - - - - - - - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - @@ -2221,13 +1669,6 @@ - - - - - - - @@ -2262,9 +1703,6 @@ - - - @@ -2273,9 +1711,6 @@ - - - @@ -2284,9 +1719,6 @@ - - - @@ -2295,9 +1727,6 @@ - - - @@ -2356,27 +1785,42 @@ + + + + + + + + + + + + + + + @@ -2386,6 +1830,21 @@ + + + + + + + + + + + + + + + @@ -2432,12 +1891,6 @@ - - - - - - @@ -2465,12 +1918,6 @@ - - - - - - @@ -2492,6 +1939,9 @@ + + + @@ -2510,9 +1960,6 @@ - - - @@ -2532,10 +1979,25 @@ - + + + + - + + + + + + + + + + + + + @@ -2553,19 +2015,7 @@ - - - - - - - - - - - - - + @@ -2576,27 +2026,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -2648,12 +2077,6 @@ - - - - - - @@ -2675,12 +2098,6 @@ - - - - - - @@ -2699,15 +2116,6 @@ - - - - - - - - - @@ -2726,45 +2134,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2798,6 +2167,9 @@ + + + @@ -2807,9 +2179,6 @@ - - - @@ -2819,15 +2188,6 @@ - - - - - - - - - @@ -2846,15 +2206,6 @@ - - - - - - - - - @@ -2876,57 +2227,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2951,21 +2251,12 @@ - - - - - - - - - @@ -3016,6 +2307,9 @@ + + + @@ -3025,21 +2319,12 @@ - - - - - - - - - @@ -3052,10 +2337,6 @@ - - - - @@ -3087,7 +2368,6 @@ - @@ -3100,18 +2380,6 @@ - - - - - - - - - - - - @@ -3130,15 +2398,6 @@ - - - - - - - - - @@ -3157,15 +2416,6 @@ - - - - - - - - - @@ -3184,42 +2434,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3233,7 +2447,6 @@ - @@ -3246,15 +2459,6 @@ - - - - - - - - - @@ -3273,15 +2477,6 @@ - - - - - - - - - @@ -3300,15 +2495,6 @@ - - - - - - - - - @@ -3330,33 +2516,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3367,4423 +2526,3318 @@
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
+ +
+
+
+ + +
+
+
+ + +
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
- -
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
- -
-
-
- - -
+ +
-
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
+ +
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
- -
-
-
+ +
+
+
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
-
- - -
-
-
- - -
-
+ +
+
- -
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
- -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
-
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - +
-
-
+
+
- -
-
-
+ +
+
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
-
+ +
+
+
- -
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
- -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
- -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
-
- - -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
+ +
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
-
+ +
+
+
- + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ +
- +
- +
- -
-
-
+ +
+
+
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
- -
-
-
+ +
+
+
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
- -
-
-
+ +
+
+
- -
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + +
+
- -
-
+ +
+
- -
-
-
- - +
-
-
+
+
- -
-
-
+ +
+
+
- -
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
- -
-
+ +
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
-
+ +
+
+
- -
-
-
+ +
+
+
- -
-
-
- - -
-
+ +
+
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
+ +
-
+
- -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
+ +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
- -
-
+ +
+
- -
-
-
+ +
+
+
- -
-
+ +
+
+
+ + +
+
+
+ + +
+
- +
+
+
+ + +
+
+
+ + +
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
+
+ + +
+
- -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
+ +
+
- -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
- - -
-
-
+ +
+
+
diff --git a/workspace/fr.n7.game.toPrototype/bin/fr/n7/game/toPrototype/main/toPrototype.mtl b/workspace/fr.n7.game.toPrototype/bin/fr/n7/game/toPrototype/main/toPrototype.mtl index 7811424..3d3a382 100644 --- a/workspace/fr.n7.game.toPrototype/bin/fr/n7/game/toPrototype/main/toPrototype.mtl +++ b/workspace/fr.n7.game.toPrototype/bin/fr/n7/game/toPrototype/main/toPrototype.mtl @@ -9,320 +9,281 @@ import java.util.ArrayList; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; +import java.util.Map; +import static java.util.Map.entry; public class Prototype { public static void main(String['['/][']'/] args) { [comment Objets /] // "Objets" - -List jeu_objets = new ArrayList<>(); - -[for (o : Objet | jeu.objets)] - [print_descriptions(o.descriptions, 'objet_' + o.name)/] - [print_condition(o.visible, 'objet_visible_' + o.name)/] - Objet objet_[o.name/] = new Objet( - "[o.name/]", - [o.taille/], - objet_visible_[o.name/]_condition, - objet_[o.name/]_descriptions - ); - jeu_objets.add(objet_[o.name/]); -[/for] +Map jeu_objets = Map.ofEntries( + [for (o : Objet | jeu.objets)] + entry( + "[o.name/]", + new Objet( + "[o.name/]", + [o.taille/], + [print_condition(o.visible)/], + [print_descriptions(o.descriptions)/] + ) + )[if (i <> jeu.objets->size())],[/if] + [/for] +); [comment Connaissances /] // "Connaissances" - -List jeu_connaissances = new ArrayList<>(); - -[for (c : Connaissance | jeu.connaissances)] - [print_descriptions(c.descriptions, 'connaissance_' + c.name)/] - [print_condition(c.visible, 'connaissance_visible_' + c.name)/] - Connaissance connaissance_[c.name/] = new Connaissance( - "[c.name/]", - connaissance_visible_[c.name/]_condition, - connaissance_[c.name/]_descriptions - ); - jeu_connaissances.add(connaissance_[c.name/]); -[/for] +Map jeu_connaissances = Map.ofEntries( + [for (c : Connaissance | jeu.connaissances)] + entry( + "[c.name/]", + new Objet( + "[c.name/]", + [print_condition(c.visible)/], + [print_descriptions(c.descriptions)/] + ) + )[if (i <> jeu.connaissances->size())],[/if] + [/for] +); [comment Transformations /] // "Transformations" - -List jeu_transformations = new ArrayList<>(); - -[for (t : Transformation | jeu.transformations)] - [print_condition(t.condition, 'transformation_' + i.toString())/] - - List transformation_[i/]_objets_in = new ArrayList<>(); - [for (c : Objet | t.objetsIn)] - transformation_[i/]_objets_in.add(objet_[c.name/]); - [/for] - List transformation_[i/]_objets_out = new ArrayList<>(); - [for (c : Objet | t.objetsOut)] - transformation_[i/]_objets_out.add(objet_[c.name/]); - [/for] - - jeu_transformations.add( +Map jeu_transformations = Map.ofEntries( + [for (t : Transformation | jeu.transformations)] + entry( + "[t.name/]", new Transformation( - transformation_[i/]_condition, - transformation_[i/]_objets_in, - transformation_[i/]_objets_out + "[t.name/]", + [print_condition(t.condition)/], + List.of( + [for (o : Objet | t.objetsIn)] + jeu_connaissances.get("[o.name/]")[if (i <> t.objetsIn->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | t.objetsOut)] + jeu_connaissances.get("[o.name/]")[if (i <> t.objetsOut->size())],[/if] + [/for] + ) ) - ); -[/for] + )[if (i <> jeu.transformations->size())],[/if] + [/for] +); [comment Explorateur /] // "Explorateur" - -List explorateur_inventaire = new ArrayList<>(); -[for (o : Objet | jeu.explorateur.objets)] - explorateur_inventaire.add(objet_[o.name/]); -[/for] - -List explorateur_connaissances = new ArrayList<>(); -[for (c : Connaissance | jeu.explorateur.connaissances)] - explorateur_inventaire.add(connaissance_[c.name/]); -[/for] - Jeu.explorateur = new Explorateur( [jeu.explorateur.tailleInventaire/], - explorateur_connaissances, - explorateur_inventaire + List.of( + [for (c : Connaissance | jeu.explorateur.connaissances)] + jeu_connaissances.get("[c.name/]")[if (i <> jeu.explorateur.connaissances->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | jeu.explorateur.objets)] + jeu_objets.get("[o.name/]")[if (i <> jeu.explorateur.objets->size())],[/if] + [/for] + ) ); [comment Personnes /] // "Personnes" - -List jeu_personnes = new ArrayList<>(); -[for (p : Personne | jeu.personnes)] - - [print_condition(p.visible, 'personne_visible_' + p.name + '_' + i.toString())/] - [print_condition(p.obligatoire, 'personne_obligatoire_' + p.name + '_' + i.toString())/] - [print_interactions(p.interactions, 'personne_' + p.name + '_' + i.toString())/] - - Personne personne_[p.name/] = new Personne( +Map jeu_personnes = Map.ofEntries( + [for (p : Personne | jeu.personnes)] + entry( "[p.name/]", - personne_visible_[p.name/]_[i/]_condition, - personne_obligatoire_[p.name/]_[i/]_condition, - personne_[p.name/]_[i/]_interactions - ); - - jeu_personnes.add(personne_[p.name/]); -[/for] + new Personne( + "[p.name/]", + [print_condition(p.visible)/], + [print_condition(p.obligatoire)/], + [print_interactions(p.interactions)/] + ) + )[if (i <> jeu.personnes->size())],[/if] + [/for] +); [comment Lieux /] // "Lieux" - -List territoire_lieux = new ArrayList<>(); -[for (l : Lieu | jeu.territoire.lieux)] - [print_condition(l.deposable, 'lieu_deposable_' + i.toString())/] - [print_condition(l.depart, 'lieu_depart_' + i.toString())/] - [print_condition(l.fin, 'lieu_fin_' + i.toString())/] - [print_descriptions(l.descriptions, 'lieu_' + l.name + '_' + i.toString())/] - - List lieu_[l.name/]_[i/]_personnes = new ArrayList<>(); - [for (p : Personne | l.personnes)] - lieu_[l.name/]_[i/]_personnes.add(personne_[p.name/]); - [/for] - List lieu_[l.name/]_[i/]_objets = new ArrayList<>(); - [for (o : Objet | l.objets)] - lieu_[l.name/]_[i/]_objets.add(objet_[o.name/]); - [/for] - List lieu_[l.name/]_[i/]_connaissances = new ArrayList<>(); - [for (c : Connaissance | l.connaissances)] - lieu_[l.name/]_[i/]_connaissances.add(connaissance_[c.name/]); - [/for] - - // TODO: utiliser un search dans la liste plutot que de déclarer les objets - Lieu lieu_[l.name/] = new Lieu( +Map territoire_lieux = Map.ofEntries( + [for (l : Lieu | jeu.territoire.lieux)] + entry( "[l.name/]", - lieu_deposable_[i/]_condition, - lieu_depart_[i/]_condition, - lieu_fin_[i/]_condition, - lieu_[l.name/]_[i/]_personnes, - lieu_[l.name/]_[i/]_descriptions, - lieu_[l.name/]_[i/]_objets, - lieu_[l.name/]_[i/]_connaissances - ); - - territoire_lieux.add(lieu_[l.name/]); -[/for] - + new Lieu( + "[l.name/]", + [print_condition(l.deposable)/], + [print_condition(l.depart)/], + [print_condition(l.fin)/], + List.of( + [for (p : Personne | l.personnes)] + jeu_personnes.get("[p.name/]")[if (i <> l.personnes->size())],[/if] + [/for] + ), + [print_descriptions(l.descriptions)/], + List.of( + [for (o : Objet | l.objets)] + jeu_personnes.get("[o.name/]")[if (i <> l.objets->size())],[/if] + [/for] + ), + List.of( + [for (c : Connaissance | l.connaissances)] + jeu_personnes.get("[c.name/]")[if (i <> l.connaissances->size())],[/if] + [/for] + ) + ) + )[if (i <> jeu.territoire.lieux->size())],[/if] + [/for] +); [comment Chemins /] // "Chemins" -List territoire_chemins = new ArrayList<>(); -[for (ch : Chemin | jeu.territoire.chemins)] - [print_condition(ch.ouvert, 'chemin_ouvert_' + ch.name + '_' + i.toString())/] - [print_condition(ch.visible, 'chemin_visible_' + ch.name + '_' + i.toString())/] - [print_condition(ch.obligatoire, 'chemin_obligatoire_' + ch.name + '_' + i.toString())/] - [print_descriptions(ch.descriptions, 'chemin_' + ch.name + '_' + i.toString())/] - - List chemin_[ch.name/]_[i/]_connaissances = new ArrayList<>(); - [for (c : Connaissance | ch.connaissances)] - chemin_[ch.name/]_[i/]_connaissances.add(connaissance_[c.name/]); - [/for] - List chemin_[ch.name/]_[i/]_objets_recus = new ArrayList<>(); - [for (o : Objet | ch.objetsRecus)] - chemin_[ch.name/]_[i/]_objets_recus.add(objet_[o.name/]); - [/for] - List chemin_[ch.name/]_[i/]_objets_conso = new ArrayList<>(); - [for (o : Objet | ch.objetsConso)] - chemin_[ch.name/]_[i/]_objets_conso.add(objet_[o.name/]); +Map territoire_chemins = Map.ofEntries( + [for (c : Chemin | jeu.territoire.chemins)] + entry( + "[c.name/]", + new Chemin( + "[c.name/]", + territoire_lieux.get("[c.lieuIn.name/]"), + territoire_lieux.get("[c.lieuOut.name/]") + [print_condition(c.ouvert)/], + [print_condition(c.visible)/], + [print_condition(c.obligatoire)/], + List.of( + [for (co : Connaissance | c.connaissances)] + jeu_connaissances.get("[co.name/]")[if (i <> c.connaissances->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | c.objetsRecus)] + jeu_personnes.get("[o.name/]")[if (i <> c.objetsRecus->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | c.objetsConso)] + jeu_personnes.get("[o.name/]")[if (i <> c.objetsConso->size())],[/if] + [/for] + ), + [print_descriptions(c.descriptions)/] + ) + )[if (i <> jeu.territoire.lieux->size())],[/if] [/for] +); - Chemin chemins_[ch.name/] = new Chemin( - "[ch.name/]", - lieu_[ch.lieuIn.name/], - lieu_[ch.lieuOut.name/], - chemin_ouvert_[ch.name/]_[i/]_condition, - chemin_visible_[ch.name/]_[i/]_condition, - chemin_obligatoire_[ch.name/]_[i/]_condition, - chemin_[ch.name/]_[i/]_connaissances, - chemin_[ch.name/]_[i/]_objets_recus, - chemin_[ch.name/]_[i/]_objets_conso, - chemin_[ch.name/]_[i/]_descriptions - ); +[comment Territoire /] +// Territoire +Territoire jeu_territoire = new Territoire(territoire_lieux, territoire_chemins); - territoire_chemins.add(chemins_[ch.name/]); -[/for] +[comment Jeu/] +// Jeu +Jeu ze_GAME = new Jeu( + jeu_territoire, + jeu_objets, + jeu_connaissances, + jeu_personnes, + jeu_transformations +); - Territoire jeu_territoire = new Territoire(territoire_lieux, territoire_chemins); - - Jeu ze_GAME = new Jeu( - jeu_territoire, - jeu_objets, - jeu_connaissances, - jeu_personnes, - jeu_transformations - ); - - ze_GAME.jouer(); +ze_GAME.jouer(); } } [/file] [/template] -[template public print_condition(c : Condition, name: String) post (trim()) ] -List [name/]_conditions_ET_list = new ArrayList<>(); - -[for (cET : ConditionEt | c.condition)] -List [name/]_conditions_TEST_list = new ArrayList<>(); - - [for (cTEST : ConditionTest | cET.conditionTest)] - [name/]_conditions_TEST_list.add( - [if (cTEST.oclIsKindOf(ConditionBoolean))] - [let cBOOL : ConditionBoolean = cTEST.oclAsType(ConditionBoolean)] - new ConditionBoolean([cBOOL.valeur/]) - [/let] - [elseif (cTEST.oclIsKindOf(ConditionConnaissance))] - [let cCONN : ConditionConnaissance = cTEST.oclAsType(ConditionConnaissance)] - new ConditionConnaissance( - connaissance_[cCONN.connaissance/], - [if (cCONN.negation = '!')]true[else]false[/if] - ) - [/let] - [elseif (cTEST.oclIsKindOf(ConditionObjet))] - [let cOBJET : ConditionObjet = cTEST.oclAsType(ConditionObjet)] - new ConditionObjet( - objet_[cOBJET.objet/], - "[cOBJET.comparateur/]", - [cOBJET.nombre/] - ) - [/let] - [/if] - ); - [/for] - [name/]_conditions_ET_list.add( - new ConditionEt([name/]_conditions_TEST_list) - ); -[/for] - -Condition [name/]_condition = new Condition([name/]_conditions_ET_list); -[/template] - -[template public print_descriptions(ds : OrderedSet(Description), name: String) post (trim()) ] -List [name/]_descriptions = new ArrayList<>(); - -[for (d : Description | ds)] - [print_condition(d.condition, name + '_description_' + i.toString())/] - - [name/]_descriptions.add( - new Description( - "[d.texte/]", - [name/]_description_[i/]_condition - ) - ); -[/for] -[/template] - -[template public print_actions(as : OrderedSet(Action), name: String) post (trim()) ] -List [name/]_actions = new ArrayList<>(); - -[for (a : Action | as)] - [print_condition(a.visible, name + '_action_visible_' + i.toString())/] - [print_condition(a.finInteraction, name + '_action_fin_' + i.toString())/] - [print_descriptions(a.descriptions, name + '_action_' + i.toString())/] - - List [name/]_action_[i/]_connaissances = new ArrayList<>(); - [for (c : Connaissance | a.connaissances)] - [name/]_action_[i/]_connaissances.add(connaissance_[c.name/]); - [/for] - List [name/]_action_[i/]_objets_conso = new ArrayList<>(); - [let test : String = name + '_action_' + i + '_objets_conso'] // TODO: OMG C DÉGUEULASSE -> LE FAIRE PARTOUT - [for (c : Objet | a.objetsConso)] - [test/].add(objet_[c.name/]); +[template public print_condition(c : Condition) post (trim()) ] +new Condition( + List.of( + [for (cET : ConditionEt | c.condition)] + List.of( + [for (cTEST : ConditionTest | cET.conditionTest)] + [if (cTEST.oclIsKindOf(ConditionBoolean))] + [let cBOOL : ConditionBoolean = cTEST.oclAsType(ConditionBoolean)] + new ConditionBoolean([cBOOL.valeur/]) + [/let] + [elseif (cTEST.oclIsKindOf(ConditionConnaissance))] + [let cCONN : ConditionConnaissance = cTEST.oclAsType(ConditionConnaissance)] + new ConditionConnaissance( + connaissance_[cCONN.connaissance.name/], + [if (cCONN.negation = '!')]true[else]false[/if] + ) + [/let] + [elseif (cTEST.oclIsKindOf(ConditionObjet))] + [let cOBJET : ConditionObjet = cTEST.oclAsType(ConditionObjet)] + new ConditionObjet( + objet_[cOBJET.objet.name/], + "[cOBJET.comparateur/]", + [cOBJET.nombre/] + ) + [/let] + [/if][if (i < cET.conditionTest->size())],[/if] + [/for] + )[if (i < c.condition->size())],[/if] [/for] - [/let] - List [name/]_action_[i/]_objets_recus = new ArrayList<>(); - [for (c : Objet | a.objetsRecus)] - [name/]_action_[i/]_objets_recus.add(objet_[c.name/]); - [/for] - - [name/]_actions.add( - new Action( - [name/]_action_visible_[i/]_condition, - [name/]_action_fin_[i/]_condition, - [name/]_action_[i/]_connaissances, - [name/]_action_[i/]_objets_recus, - [name/]_action_[i/]_objets_conso, - [name/]_action_[i/]_descriptions - ) - ); -[/for] + ) +) [/template] -[template public print_interactions(is: OrderedSet(Interaction), name: String)] -List [name/]_interactions = new ArrayList<>(); +[template public print_descriptions(ds : OrderedSet(Description)) post (trim()) ] +List.of( + [for (d : Description | ds)] + new Description( + "[d.name/]" + "[d.texte/]", + [print_condition(d.condition)/] + )[if (i < ds->size())],[/if] + [/for] +) +[/template] -[for (it : Interaction | is)] - [print_condition(it.visible, name + '_interaction_visible_' + i.toString())/] - [print_actions(it.actions, name + '_interaction_' + i.toString())/] +[template public print_actions(as : OrderedSet(Action)) post (trim()) ] +List.of( + [for (a : Action | as)] + new Action( + [print_condition(a.visible)/], + [print_condition(a.finInteraction)/], + List.of( + [for (co : Connaissance | a.connaissances)] + jeu_connaissances.get("[co.name/]")[if (i <> a.connaissances->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | a.objetsRecus)] + jeu_personnes.get("[o.name/]")[if (i <> a.objetsRecus->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | a.objetsConso)] + jeu_personnes.get("[o.name/]")[if (i <> a.objetsConso->size())],[/if] + [/for] + ), + )[if (i < as->size())],[/if] + [/for] +) +[/template] - List [name/]_interaction_[i/]_connaissances = new ArrayList<>(); - [for (c : Connaissance | it.connaissances)] - [name/]_interaction_[i/]_connaissances.add(connaissance_[c.name/]); +[template public print_interactions(is: OrderedSet(Interaction))] +List.of( + [for (it : Interaction | is)] + new Interaction( + "[it.name/]" + [print_condition(it.visible)/], + List.of( + [for (co : Connaissance | it.connaissances)] + jeu_connaissances.get("[co.name/]")[if (i <> it.connaissances->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | it.objetsConso)] + jeu_personnes.get("[o.name/]")[if (i <> it.objetsConso->size())],[/if] + [/for] + ), // TODO: inverser recu et conso + List.of( + [for (o : Objet | it.objetsRecus)] + jeu_personnes.get("[o.name/]")[if (i <> it.objetsRecus->size())],[/if] + [/for] + ), + [print_actions(it.actions)/] + )[if (i < is->size())],[/if] [/for] - List [name/]_interaction_[i/]_objets_conso = new ArrayList<>(); - [for (c : Objet | it.objetsConso)] - [name/]_interaction_[i/]_objets_conso.add(objet_[c.name/]); - [/for] - List [name/]_interaction_[i/]_objets_recus = new ArrayList<>(); - [for (c : Objet | it.objetsRecus)] - [name/]_interaction_[i/]_objets_recus.add(objet_[c.name/]); - [/for] - - [name/]_interactions.add( - new Interaction( - [name/]_interaction_visible_[i/]_condition, - [name/]_interaction_[i/]_connaissances, - [name/]_interaction_[i/]_objets_conso, - [name/]_interaction_[i/]_objets_recus, - [name/]_interaction_[i/]_actions - ) - ); -[/for] +) [/template] \ No newline at end of file diff --git a/workspace/fr.n7.game.toPrototype/src/fr/n7/game/toPrototype/main/toPrototype.mtl b/workspace/fr.n7.game.toPrototype/src/fr/n7/game/toPrototype/main/toPrototype.mtl index 7811424..3d3a382 100644 --- a/workspace/fr.n7.game.toPrototype/src/fr/n7/game/toPrototype/main/toPrototype.mtl +++ b/workspace/fr.n7.game.toPrototype/src/fr/n7/game/toPrototype/main/toPrototype.mtl @@ -9,320 +9,281 @@ import java.util.ArrayList; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; +import java.util.Map; +import static java.util.Map.entry; public class Prototype { public static void main(String['['/][']'/] args) { [comment Objets /] // "Objets" - -List jeu_objets = new ArrayList<>(); - -[for (o : Objet | jeu.objets)] - [print_descriptions(o.descriptions, 'objet_' + o.name)/] - [print_condition(o.visible, 'objet_visible_' + o.name)/] - Objet objet_[o.name/] = new Objet( - "[o.name/]", - [o.taille/], - objet_visible_[o.name/]_condition, - objet_[o.name/]_descriptions - ); - jeu_objets.add(objet_[o.name/]); -[/for] +Map jeu_objets = Map.ofEntries( + [for (o : Objet | jeu.objets)] + entry( + "[o.name/]", + new Objet( + "[o.name/]", + [o.taille/], + [print_condition(o.visible)/], + [print_descriptions(o.descriptions)/] + ) + )[if (i <> jeu.objets->size())],[/if] + [/for] +); [comment Connaissances /] // "Connaissances" - -List jeu_connaissances = new ArrayList<>(); - -[for (c : Connaissance | jeu.connaissances)] - [print_descriptions(c.descriptions, 'connaissance_' + c.name)/] - [print_condition(c.visible, 'connaissance_visible_' + c.name)/] - Connaissance connaissance_[c.name/] = new Connaissance( - "[c.name/]", - connaissance_visible_[c.name/]_condition, - connaissance_[c.name/]_descriptions - ); - jeu_connaissances.add(connaissance_[c.name/]); -[/for] +Map jeu_connaissances = Map.ofEntries( + [for (c : Connaissance | jeu.connaissances)] + entry( + "[c.name/]", + new Objet( + "[c.name/]", + [print_condition(c.visible)/], + [print_descriptions(c.descriptions)/] + ) + )[if (i <> jeu.connaissances->size())],[/if] + [/for] +); [comment Transformations /] // "Transformations" - -List jeu_transformations = new ArrayList<>(); - -[for (t : Transformation | jeu.transformations)] - [print_condition(t.condition, 'transformation_' + i.toString())/] - - List transformation_[i/]_objets_in = new ArrayList<>(); - [for (c : Objet | t.objetsIn)] - transformation_[i/]_objets_in.add(objet_[c.name/]); - [/for] - List transformation_[i/]_objets_out = new ArrayList<>(); - [for (c : Objet | t.objetsOut)] - transformation_[i/]_objets_out.add(objet_[c.name/]); - [/for] - - jeu_transformations.add( +Map jeu_transformations = Map.ofEntries( + [for (t : Transformation | jeu.transformations)] + entry( + "[t.name/]", new Transformation( - transformation_[i/]_condition, - transformation_[i/]_objets_in, - transformation_[i/]_objets_out + "[t.name/]", + [print_condition(t.condition)/], + List.of( + [for (o : Objet | t.objetsIn)] + jeu_connaissances.get("[o.name/]")[if (i <> t.objetsIn->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | t.objetsOut)] + jeu_connaissances.get("[o.name/]")[if (i <> t.objetsOut->size())],[/if] + [/for] + ) ) - ); -[/for] + )[if (i <> jeu.transformations->size())],[/if] + [/for] +); [comment Explorateur /] // "Explorateur" - -List explorateur_inventaire = new ArrayList<>(); -[for (o : Objet | jeu.explorateur.objets)] - explorateur_inventaire.add(objet_[o.name/]); -[/for] - -List explorateur_connaissances = new ArrayList<>(); -[for (c : Connaissance | jeu.explorateur.connaissances)] - explorateur_inventaire.add(connaissance_[c.name/]); -[/for] - Jeu.explorateur = new Explorateur( [jeu.explorateur.tailleInventaire/], - explorateur_connaissances, - explorateur_inventaire + List.of( + [for (c : Connaissance | jeu.explorateur.connaissances)] + jeu_connaissances.get("[c.name/]")[if (i <> jeu.explorateur.connaissances->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | jeu.explorateur.objets)] + jeu_objets.get("[o.name/]")[if (i <> jeu.explorateur.objets->size())],[/if] + [/for] + ) ); [comment Personnes /] // "Personnes" - -List jeu_personnes = new ArrayList<>(); -[for (p : Personne | jeu.personnes)] - - [print_condition(p.visible, 'personne_visible_' + p.name + '_' + i.toString())/] - [print_condition(p.obligatoire, 'personne_obligatoire_' + p.name + '_' + i.toString())/] - [print_interactions(p.interactions, 'personne_' + p.name + '_' + i.toString())/] - - Personne personne_[p.name/] = new Personne( +Map jeu_personnes = Map.ofEntries( + [for (p : Personne | jeu.personnes)] + entry( "[p.name/]", - personne_visible_[p.name/]_[i/]_condition, - personne_obligatoire_[p.name/]_[i/]_condition, - personne_[p.name/]_[i/]_interactions - ); - - jeu_personnes.add(personne_[p.name/]); -[/for] + new Personne( + "[p.name/]", + [print_condition(p.visible)/], + [print_condition(p.obligatoire)/], + [print_interactions(p.interactions)/] + ) + )[if (i <> jeu.personnes->size())],[/if] + [/for] +); [comment Lieux /] // "Lieux" - -List territoire_lieux = new ArrayList<>(); -[for (l : Lieu | jeu.territoire.lieux)] - [print_condition(l.deposable, 'lieu_deposable_' + i.toString())/] - [print_condition(l.depart, 'lieu_depart_' + i.toString())/] - [print_condition(l.fin, 'lieu_fin_' + i.toString())/] - [print_descriptions(l.descriptions, 'lieu_' + l.name + '_' + i.toString())/] - - List lieu_[l.name/]_[i/]_personnes = new ArrayList<>(); - [for (p : Personne | l.personnes)] - lieu_[l.name/]_[i/]_personnes.add(personne_[p.name/]); - [/for] - List lieu_[l.name/]_[i/]_objets = new ArrayList<>(); - [for (o : Objet | l.objets)] - lieu_[l.name/]_[i/]_objets.add(objet_[o.name/]); - [/for] - List lieu_[l.name/]_[i/]_connaissances = new ArrayList<>(); - [for (c : Connaissance | l.connaissances)] - lieu_[l.name/]_[i/]_connaissances.add(connaissance_[c.name/]); - [/for] - - // TODO: utiliser un search dans la liste plutot que de déclarer les objets - Lieu lieu_[l.name/] = new Lieu( +Map territoire_lieux = Map.ofEntries( + [for (l : Lieu | jeu.territoire.lieux)] + entry( "[l.name/]", - lieu_deposable_[i/]_condition, - lieu_depart_[i/]_condition, - lieu_fin_[i/]_condition, - lieu_[l.name/]_[i/]_personnes, - lieu_[l.name/]_[i/]_descriptions, - lieu_[l.name/]_[i/]_objets, - lieu_[l.name/]_[i/]_connaissances - ); - - territoire_lieux.add(lieu_[l.name/]); -[/for] - + new Lieu( + "[l.name/]", + [print_condition(l.deposable)/], + [print_condition(l.depart)/], + [print_condition(l.fin)/], + List.of( + [for (p : Personne | l.personnes)] + jeu_personnes.get("[p.name/]")[if (i <> l.personnes->size())],[/if] + [/for] + ), + [print_descriptions(l.descriptions)/], + List.of( + [for (o : Objet | l.objets)] + jeu_personnes.get("[o.name/]")[if (i <> l.objets->size())],[/if] + [/for] + ), + List.of( + [for (c : Connaissance | l.connaissances)] + jeu_personnes.get("[c.name/]")[if (i <> l.connaissances->size())],[/if] + [/for] + ) + ) + )[if (i <> jeu.territoire.lieux->size())],[/if] + [/for] +); [comment Chemins /] // "Chemins" -List territoire_chemins = new ArrayList<>(); -[for (ch : Chemin | jeu.territoire.chemins)] - [print_condition(ch.ouvert, 'chemin_ouvert_' + ch.name + '_' + i.toString())/] - [print_condition(ch.visible, 'chemin_visible_' + ch.name + '_' + i.toString())/] - [print_condition(ch.obligatoire, 'chemin_obligatoire_' + ch.name + '_' + i.toString())/] - [print_descriptions(ch.descriptions, 'chemin_' + ch.name + '_' + i.toString())/] - - List chemin_[ch.name/]_[i/]_connaissances = new ArrayList<>(); - [for (c : Connaissance | ch.connaissances)] - chemin_[ch.name/]_[i/]_connaissances.add(connaissance_[c.name/]); - [/for] - List chemin_[ch.name/]_[i/]_objets_recus = new ArrayList<>(); - [for (o : Objet | ch.objetsRecus)] - chemin_[ch.name/]_[i/]_objets_recus.add(objet_[o.name/]); - [/for] - List chemin_[ch.name/]_[i/]_objets_conso = new ArrayList<>(); - [for (o : Objet | ch.objetsConso)] - chemin_[ch.name/]_[i/]_objets_conso.add(objet_[o.name/]); +Map territoire_chemins = Map.ofEntries( + [for (c : Chemin | jeu.territoire.chemins)] + entry( + "[c.name/]", + new Chemin( + "[c.name/]", + territoire_lieux.get("[c.lieuIn.name/]"), + territoire_lieux.get("[c.lieuOut.name/]") + [print_condition(c.ouvert)/], + [print_condition(c.visible)/], + [print_condition(c.obligatoire)/], + List.of( + [for (co : Connaissance | c.connaissances)] + jeu_connaissances.get("[co.name/]")[if (i <> c.connaissances->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | c.objetsRecus)] + jeu_personnes.get("[o.name/]")[if (i <> c.objetsRecus->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | c.objetsConso)] + jeu_personnes.get("[o.name/]")[if (i <> c.objetsConso->size())],[/if] + [/for] + ), + [print_descriptions(c.descriptions)/] + ) + )[if (i <> jeu.territoire.lieux->size())],[/if] [/for] +); - Chemin chemins_[ch.name/] = new Chemin( - "[ch.name/]", - lieu_[ch.lieuIn.name/], - lieu_[ch.lieuOut.name/], - chemin_ouvert_[ch.name/]_[i/]_condition, - chemin_visible_[ch.name/]_[i/]_condition, - chemin_obligatoire_[ch.name/]_[i/]_condition, - chemin_[ch.name/]_[i/]_connaissances, - chemin_[ch.name/]_[i/]_objets_recus, - chemin_[ch.name/]_[i/]_objets_conso, - chemin_[ch.name/]_[i/]_descriptions - ); +[comment Territoire /] +// Territoire +Territoire jeu_territoire = new Territoire(territoire_lieux, territoire_chemins); - territoire_chemins.add(chemins_[ch.name/]); -[/for] +[comment Jeu/] +// Jeu +Jeu ze_GAME = new Jeu( + jeu_territoire, + jeu_objets, + jeu_connaissances, + jeu_personnes, + jeu_transformations +); - Territoire jeu_territoire = new Territoire(territoire_lieux, territoire_chemins); - - Jeu ze_GAME = new Jeu( - jeu_territoire, - jeu_objets, - jeu_connaissances, - jeu_personnes, - jeu_transformations - ); - - ze_GAME.jouer(); +ze_GAME.jouer(); } } [/file] [/template] -[template public print_condition(c : Condition, name: String) post (trim()) ] -List [name/]_conditions_ET_list = new ArrayList<>(); - -[for (cET : ConditionEt | c.condition)] -List [name/]_conditions_TEST_list = new ArrayList<>(); - - [for (cTEST : ConditionTest | cET.conditionTest)] - [name/]_conditions_TEST_list.add( - [if (cTEST.oclIsKindOf(ConditionBoolean))] - [let cBOOL : ConditionBoolean = cTEST.oclAsType(ConditionBoolean)] - new ConditionBoolean([cBOOL.valeur/]) - [/let] - [elseif (cTEST.oclIsKindOf(ConditionConnaissance))] - [let cCONN : ConditionConnaissance = cTEST.oclAsType(ConditionConnaissance)] - new ConditionConnaissance( - connaissance_[cCONN.connaissance/], - [if (cCONN.negation = '!')]true[else]false[/if] - ) - [/let] - [elseif (cTEST.oclIsKindOf(ConditionObjet))] - [let cOBJET : ConditionObjet = cTEST.oclAsType(ConditionObjet)] - new ConditionObjet( - objet_[cOBJET.objet/], - "[cOBJET.comparateur/]", - [cOBJET.nombre/] - ) - [/let] - [/if] - ); - [/for] - [name/]_conditions_ET_list.add( - new ConditionEt([name/]_conditions_TEST_list) - ); -[/for] - -Condition [name/]_condition = new Condition([name/]_conditions_ET_list); -[/template] - -[template public print_descriptions(ds : OrderedSet(Description), name: String) post (trim()) ] -List [name/]_descriptions = new ArrayList<>(); - -[for (d : Description | ds)] - [print_condition(d.condition, name + '_description_' + i.toString())/] - - [name/]_descriptions.add( - new Description( - "[d.texte/]", - [name/]_description_[i/]_condition - ) - ); -[/for] -[/template] - -[template public print_actions(as : OrderedSet(Action), name: String) post (trim()) ] -List [name/]_actions = new ArrayList<>(); - -[for (a : Action | as)] - [print_condition(a.visible, name + '_action_visible_' + i.toString())/] - [print_condition(a.finInteraction, name + '_action_fin_' + i.toString())/] - [print_descriptions(a.descriptions, name + '_action_' + i.toString())/] - - List [name/]_action_[i/]_connaissances = new ArrayList<>(); - [for (c : Connaissance | a.connaissances)] - [name/]_action_[i/]_connaissances.add(connaissance_[c.name/]); - [/for] - List [name/]_action_[i/]_objets_conso = new ArrayList<>(); - [let test : String = name + '_action_' + i + '_objets_conso'] // TODO: OMG C DÉGUEULASSE -> LE FAIRE PARTOUT - [for (c : Objet | a.objetsConso)] - [test/].add(objet_[c.name/]); +[template public print_condition(c : Condition) post (trim()) ] +new Condition( + List.of( + [for (cET : ConditionEt | c.condition)] + List.of( + [for (cTEST : ConditionTest | cET.conditionTest)] + [if (cTEST.oclIsKindOf(ConditionBoolean))] + [let cBOOL : ConditionBoolean = cTEST.oclAsType(ConditionBoolean)] + new ConditionBoolean([cBOOL.valeur/]) + [/let] + [elseif (cTEST.oclIsKindOf(ConditionConnaissance))] + [let cCONN : ConditionConnaissance = cTEST.oclAsType(ConditionConnaissance)] + new ConditionConnaissance( + connaissance_[cCONN.connaissance.name/], + [if (cCONN.negation = '!')]true[else]false[/if] + ) + [/let] + [elseif (cTEST.oclIsKindOf(ConditionObjet))] + [let cOBJET : ConditionObjet = cTEST.oclAsType(ConditionObjet)] + new ConditionObjet( + objet_[cOBJET.objet.name/], + "[cOBJET.comparateur/]", + [cOBJET.nombre/] + ) + [/let] + [/if][if (i < cET.conditionTest->size())],[/if] + [/for] + )[if (i < c.condition->size())],[/if] [/for] - [/let] - List [name/]_action_[i/]_objets_recus = new ArrayList<>(); - [for (c : Objet | a.objetsRecus)] - [name/]_action_[i/]_objets_recus.add(objet_[c.name/]); - [/for] - - [name/]_actions.add( - new Action( - [name/]_action_visible_[i/]_condition, - [name/]_action_fin_[i/]_condition, - [name/]_action_[i/]_connaissances, - [name/]_action_[i/]_objets_recus, - [name/]_action_[i/]_objets_conso, - [name/]_action_[i/]_descriptions - ) - ); -[/for] + ) +) [/template] -[template public print_interactions(is: OrderedSet(Interaction), name: String)] -List [name/]_interactions = new ArrayList<>(); +[template public print_descriptions(ds : OrderedSet(Description)) post (trim()) ] +List.of( + [for (d : Description | ds)] + new Description( + "[d.name/]" + "[d.texte/]", + [print_condition(d.condition)/] + )[if (i < ds->size())],[/if] + [/for] +) +[/template] -[for (it : Interaction | is)] - [print_condition(it.visible, name + '_interaction_visible_' + i.toString())/] - [print_actions(it.actions, name + '_interaction_' + i.toString())/] +[template public print_actions(as : OrderedSet(Action)) post (trim()) ] +List.of( + [for (a : Action | as)] + new Action( + [print_condition(a.visible)/], + [print_condition(a.finInteraction)/], + List.of( + [for (co : Connaissance | a.connaissances)] + jeu_connaissances.get("[co.name/]")[if (i <> a.connaissances->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | a.objetsRecus)] + jeu_personnes.get("[o.name/]")[if (i <> a.objetsRecus->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | a.objetsConso)] + jeu_personnes.get("[o.name/]")[if (i <> a.objetsConso->size())],[/if] + [/for] + ), + )[if (i < as->size())],[/if] + [/for] +) +[/template] - List [name/]_interaction_[i/]_connaissances = new ArrayList<>(); - [for (c : Connaissance | it.connaissances)] - [name/]_interaction_[i/]_connaissances.add(connaissance_[c.name/]); +[template public print_interactions(is: OrderedSet(Interaction))] +List.of( + [for (it : Interaction | is)] + new Interaction( + "[it.name/]" + [print_condition(it.visible)/], + List.of( + [for (co : Connaissance | it.connaissances)] + jeu_connaissances.get("[co.name/]")[if (i <> it.connaissances->size())],[/if] + [/for] + ), + List.of( + [for (o : Objet | it.objetsConso)] + jeu_personnes.get("[o.name/]")[if (i <> it.objetsConso->size())],[/if] + [/for] + ), // TODO: inverser recu et conso + List.of( + [for (o : Objet | it.objetsRecus)] + jeu_personnes.get("[o.name/]")[if (i <> it.objetsRecus->size())],[/if] + [/for] + ), + [print_actions(it.actions)/] + )[if (i < is->size())],[/if] [/for] - List [name/]_interaction_[i/]_objets_conso = new ArrayList<>(); - [for (c : Objet | it.objetsConso)] - [name/]_interaction_[i/]_objets_conso.add(objet_[c.name/]); - [/for] - List [name/]_interaction_[i/]_objets_recus = new ArrayList<>(); - [for (c : Objet | it.objetsRecus)] - [name/]_interaction_[i/]_objets_recus.add(objet_[c.name/]); - [/for] - - [name/]_interactions.add( - new Interaction( - [name/]_interaction_visible_[i/]_condition, - [name/]_interaction_[i/]_connaissances, - [name/]_interaction_[i/]_objets_conso, - [name/]_interaction_[i/]_objets_recus, - [name/]_interaction_[i/]_actions - ) - ); -[/for] +) [/template] \ No newline at end of file diff --git a/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGame.g b/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGame.g index effa784..d827adb 100644 --- a/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGame.g +++ b/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGame.g @@ -8208,9 +8208,13 @@ rule__ConditionConnaissance__ConnaissanceAssignment_1 } : ( - { before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); } - RULE_ID - { after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); } + { before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0()); } + ( + { before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1()); } + RULE_ID + { after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1()); } + ) + { after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0()); } ) ; finally { @@ -8223,9 +8227,13 @@ rule__ConditionObjet__ObjetAssignment_0 } : ( - { before(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); } - RULE_ID - { after(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); } + { before(grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0()); } + ( + { before(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1()); } + RULE_ID + { after(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1()); } + ) + { after(grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0()); } ) ; finally { diff --git a/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGameLexer.java b/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGameLexer.java index 69c2e83..74af28c 100644 --- a/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGameLexer.java +++ b/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGameLexer.java @@ -808,10 +808,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_COMPARATEUR; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8265:18: ( ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) ) - // InternalGame.g:8265:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) + // InternalGame.g:8273:18: ( ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) ) + // InternalGame.g:8273:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) { - // InternalGame.g:8265:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) + // InternalGame.g:8273:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) int alt1=6; switch ( input.LA(1) ) { case '<': @@ -855,21 +855,21 @@ public class InternalGameLexer extends Lexer { switch (alt1) { case 1 : - // InternalGame.g:8265:21: '<' + // InternalGame.g:8273:21: '<' { match('<'); } break; case 2 : - // InternalGame.g:8265:25: '>' + // InternalGame.g:8273:25: '>' { match('>'); } break; case 3 : - // InternalGame.g:8265:29: '==' + // InternalGame.g:8273:29: '==' { match("=="); @@ -877,7 +877,7 @@ public class InternalGameLexer extends Lexer { } break; case 4 : - // InternalGame.g:8265:34: '<=' + // InternalGame.g:8273:34: '<=' { match("<="); @@ -885,7 +885,7 @@ public class InternalGameLexer extends Lexer { } break; case 5 : - // InternalGame.g:8265:39: '>=' + // InternalGame.g:8273:39: '>=' { match(">="); @@ -893,7 +893,7 @@ public class InternalGameLexer extends Lexer { } break; case 6 : - // InternalGame.g:8265:44: '!=' + // InternalGame.g:8273:44: '!=' { match("!="); @@ -919,10 +919,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_BOOLEAN; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8267:14: ( ( 'true' | 'false' ) ) - // InternalGame.g:8267:16: ( 'true' | 'false' ) + // InternalGame.g:8275:14: ( ( 'true' | 'false' ) ) + // InternalGame.g:8275:16: ( 'true' | 'false' ) { - // InternalGame.g:8267:16: ( 'true' | 'false' ) + // InternalGame.g:8275:16: ( 'true' | 'false' ) int alt2=2; int LA2_0 = input.LA(1); @@ -940,7 +940,7 @@ public class InternalGameLexer extends Lexer { } switch (alt2) { case 1 : - // InternalGame.g:8267:17: 'true' + // InternalGame.g:8275:17: 'true' { match("true"); @@ -948,7 +948,7 @@ public class InternalGameLexer extends Lexer { } break; case 2 : - // InternalGame.g:8267:24: 'false' + // InternalGame.g:8275:24: 'false' { match("false"); @@ -974,10 +974,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8269:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // InternalGame.g:8269:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalGame.g:8277:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + // InternalGame.g:8277:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* { - // InternalGame.g:8269:11: ( '^' )? + // InternalGame.g:8277:11: ( '^' )? int alt3=2; int LA3_0 = input.LA(1); @@ -986,7 +986,7 @@ public class InternalGameLexer extends Lexer { } switch (alt3) { case 1 : - // InternalGame.g:8269:11: '^' + // InternalGame.g:8277:11: '^' { match('^'); @@ -1004,7 +1004,7 @@ public class InternalGameLexer extends Lexer { recover(mse); throw mse;} - // InternalGame.g:8269:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalGame.g:8277:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* loop4: do { int alt4=2; @@ -1053,10 +1053,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8271:10: ( ( '0' .. '9' )+ ) - // InternalGame.g:8271:12: ( '0' .. '9' )+ + // InternalGame.g:8279:10: ( ( '0' .. '9' )+ ) + // InternalGame.g:8279:12: ( '0' .. '9' )+ { - // InternalGame.g:8271:12: ( '0' .. '9' )+ + // InternalGame.g:8279:12: ( '0' .. '9' )+ int cnt5=0; loop5: do { @@ -1070,7 +1070,7 @@ public class InternalGameLexer extends Lexer { switch (alt5) { case 1 : - // InternalGame.g:8271:13: '0' .. '9' + // InternalGame.g:8279:13: '0' .. '9' { matchRange('0','9'); @@ -1102,10 +1102,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_STRING; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8273:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // InternalGame.g:8273:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalGame.g:8281:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) + // InternalGame.g:8281:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) { - // InternalGame.g:8273:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalGame.g:8281:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) int alt8=2; int LA8_0 = input.LA(1); @@ -1123,10 +1123,10 @@ public class InternalGameLexer extends Lexer { } switch (alt8) { case 1 : - // InternalGame.g:8273:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' + // InternalGame.g:8281:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' { match('\"'); - // InternalGame.g:8273:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* + // InternalGame.g:8281:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* loop6: do { int alt6=3; @@ -1142,7 +1142,7 @@ public class InternalGameLexer extends Lexer { switch (alt6) { case 1 : - // InternalGame.g:8273:21: '\\\\' . + // InternalGame.g:8281:21: '\\\\' . { match('\\'); matchAny(); @@ -1150,7 +1150,7 @@ public class InternalGameLexer extends Lexer { } break; case 2 : - // InternalGame.g:8273:28: ~ ( ( '\\\\' | '\"' ) ) + // InternalGame.g:8281:28: ~ ( ( '\\\\' | '\"' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -1175,10 +1175,10 @@ public class InternalGameLexer extends Lexer { } break; case 2 : - // InternalGame.g:8273:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' + // InternalGame.g:8281:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' { match('\''); - // InternalGame.g:8273:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* + // InternalGame.g:8281:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* loop7: do { int alt7=3; @@ -1194,7 +1194,7 @@ public class InternalGameLexer extends Lexer { switch (alt7) { case 1 : - // InternalGame.g:8273:54: '\\\\' . + // InternalGame.g:8281:54: '\\\\' . { match('\\'); matchAny(); @@ -1202,7 +1202,7 @@ public class InternalGameLexer extends Lexer { } break; case 2 : - // InternalGame.g:8273:61: ~ ( ( '\\\\' | '\\'' ) ) + // InternalGame.g:8281:61: ~ ( ( '\\\\' | '\\'' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -1245,12 +1245,12 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_ML_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8275:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // InternalGame.g:8275:19: '/*' ( options {greedy=false; } : . )* '*/' + // InternalGame.g:8283:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalGame.g:8283:19: '/*' ( options {greedy=false; } : . )* '*/' { match("/*"); - // InternalGame.g:8275:24: ( options {greedy=false; } : . )* + // InternalGame.g:8283:24: ( options {greedy=false; } : . )* loop9: do { int alt9=2; @@ -1275,7 +1275,7 @@ public class InternalGameLexer extends Lexer { switch (alt9) { case 1 : - // InternalGame.g:8275:52: . + // InternalGame.g:8283:52: . { matchAny(); @@ -1305,12 +1305,12 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_SL_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8277:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // InternalGame.g:8277:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + // InternalGame.g:8285:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalGame.g:8285:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? { match("//"); - // InternalGame.g:8277:24: (~ ( ( '\\n' | '\\r' ) ) )* + // InternalGame.g:8285:24: (~ ( ( '\\n' | '\\r' ) ) )* loop10: do { int alt10=2; @@ -1323,7 +1323,7 @@ public class InternalGameLexer extends Lexer { switch (alt10) { case 1 : - // InternalGame.g:8277:24: ~ ( ( '\\n' | '\\r' ) ) + // InternalGame.g:8285:24: ~ ( ( '\\n' | '\\r' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -1343,7 +1343,7 @@ public class InternalGameLexer extends Lexer { } } while (true); - // InternalGame.g:8277:40: ( ( '\\r' )? '\\n' )? + // InternalGame.g:8285:40: ( ( '\\r' )? '\\n' )? int alt12=2; int LA12_0 = input.LA(1); @@ -1352,9 +1352,9 @@ public class InternalGameLexer extends Lexer { } switch (alt12) { case 1 : - // InternalGame.g:8277:41: ( '\\r' )? '\\n' + // InternalGame.g:8285:41: ( '\\r' )? '\\n' { - // InternalGame.g:8277:41: ( '\\r' )? + // InternalGame.g:8285:41: ( '\\r' )? int alt11=2; int LA11_0 = input.LA(1); @@ -1363,7 +1363,7 @@ public class InternalGameLexer extends Lexer { } switch (alt11) { case 1 : - // InternalGame.g:8277:41: '\\r' + // InternalGame.g:8285:41: '\\r' { match('\r'); @@ -1395,10 +1395,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8279:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // InternalGame.g:8279:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalGame.g:8287:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) + // InternalGame.g:8287:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ { - // InternalGame.g:8279:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalGame.g:8287:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ int cnt13=0; loop13: do { @@ -1452,8 +1452,8 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_ANY_OTHER; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:8281:16: ( . ) - // InternalGame.g:8281:18: . + // InternalGame.g:8289:16: ( . ) + // InternalGame.g:8289:18: . { matchAny(); diff --git a/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGameParser.java b/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGameParser.java index a9798cf..0e47b91 100644 --- a/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGameParser.java +++ b/workspace/fr.n7.game.xtext.ide/src-gen/fr/n7/game/xtext/ide/contentassist/antlr/internal/InternalGameParser.java @@ -1515,12 +1515,12 @@ public class InternalGameParser extends AbstractInternalContentAssistParser { { int LA1_3 = input.LA(2); - if ( (LA1_3==RULE_COMPARATEUR) ) { - alt1=3; - } - else if ( (LA1_3==EOF||LA1_3==15||LA1_3==17||(LA1_3>=19 && LA1_3<=20)||(LA1_3>=22 && LA1_3<=23)||LA1_3==25||(LA1_3>=27 && LA1_3<=28)||(LA1_3>=32 && LA1_3<=34)||LA1_3==38||LA1_3==41||LA1_3==43||(LA1_3>=45 && LA1_3<=46)) ) { + if ( (LA1_3==EOF||LA1_3==15||LA1_3==17||(LA1_3>=19 && LA1_3<=20)||(LA1_3>=22 && LA1_3<=23)||LA1_3==25||(LA1_3>=27 && LA1_3<=28)||(LA1_3>=32 && LA1_3<=34)||LA1_3==38||LA1_3==41||LA1_3==43||(LA1_3>=45 && LA1_3<=46)) ) { alt1=2; } + else if ( (LA1_3==RULE_COMPARATEUR) ) { + alt1=3; + } else { NoViableAltException nvae = new NoViableAltException("", 1, 3, input); @@ -24160,21 +24160,29 @@ public class InternalGameParser extends AbstractInternalContentAssistParser { // $ANTLR start "rule__ConditionConnaissance__ConnaissanceAssignment_1" - // InternalGame.g:8205:1: rule__ConditionConnaissance__ConnaissanceAssignment_1 : ( RULE_ID ) ; + // InternalGame.g:8205:1: rule__ConditionConnaissance__ConnaissanceAssignment_1 : ( ( RULE_ID ) ) ; public final void rule__ConditionConnaissance__ConnaissanceAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalGame.g:8209:1: ( ( RULE_ID ) ) - // InternalGame.g:8210:2: ( RULE_ID ) + // InternalGame.g:8209:1: ( ( ( RULE_ID ) ) ) + // InternalGame.g:8210:2: ( ( RULE_ID ) ) { - // InternalGame.g:8210:2: ( RULE_ID ) - // InternalGame.g:8211:3: RULE_ID + // InternalGame.g:8210:2: ( ( RULE_ID ) ) + // InternalGame.g:8211:3: ( RULE_ID ) { - before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); + before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0()); + // InternalGame.g:8212:3: ( RULE_ID ) + // InternalGame.g:8213:4: RULE_ID + { + before(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1()); match(input,RULE_ID,FOLLOW_2); - after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); + after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1()); + + } + + after(grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0()); } @@ -24197,21 +24205,29 @@ public class InternalGameParser extends AbstractInternalContentAssistParser { // $ANTLR start "rule__ConditionObjet__ObjetAssignment_0" - // InternalGame.g:8220:1: rule__ConditionObjet__ObjetAssignment_0 : ( RULE_ID ) ; + // InternalGame.g:8224:1: rule__ConditionObjet__ObjetAssignment_0 : ( ( RULE_ID ) ) ; public final void rule__ConditionObjet__ObjetAssignment_0() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalGame.g:8224:1: ( ( RULE_ID ) ) - // InternalGame.g:8225:2: ( RULE_ID ) + // InternalGame.g:8228:1: ( ( ( RULE_ID ) ) ) + // InternalGame.g:8229:2: ( ( RULE_ID ) ) { - // InternalGame.g:8225:2: ( RULE_ID ) - // InternalGame.g:8226:3: RULE_ID + // InternalGame.g:8229:2: ( ( RULE_ID ) ) + // InternalGame.g:8230:3: ( RULE_ID ) { - before(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); + before(grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0()); + // InternalGame.g:8231:3: ( RULE_ID ) + // InternalGame.g:8232:4: RULE_ID + { + before(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1()); match(input,RULE_ID,FOLLOW_2); - after(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); + after(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1()); + + } + + after(grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0()); } @@ -24234,17 +24250,17 @@ public class InternalGameParser extends AbstractInternalContentAssistParser { // $ANTLR start "rule__ConditionObjet__ComparateurAssignment_1" - // InternalGame.g:8235:1: rule__ConditionObjet__ComparateurAssignment_1 : ( RULE_COMPARATEUR ) ; + // InternalGame.g:8243:1: rule__ConditionObjet__ComparateurAssignment_1 : ( RULE_COMPARATEUR ) ; public final void rule__ConditionObjet__ComparateurAssignment_1() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalGame.g:8239:1: ( ( RULE_COMPARATEUR ) ) - // InternalGame.g:8240:2: ( RULE_COMPARATEUR ) + // InternalGame.g:8247:1: ( ( RULE_COMPARATEUR ) ) + // InternalGame.g:8248:2: ( RULE_COMPARATEUR ) { - // InternalGame.g:8240:2: ( RULE_COMPARATEUR ) - // InternalGame.g:8241:3: RULE_COMPARATEUR + // InternalGame.g:8248:2: ( RULE_COMPARATEUR ) + // InternalGame.g:8249:3: RULE_COMPARATEUR { before(grammarAccess.getConditionObjetAccess().getComparateurCOMPARATEURTerminalRuleCall_1_0()); match(input,RULE_COMPARATEUR,FOLLOW_2); @@ -24271,17 +24287,17 @@ public class InternalGameParser extends AbstractInternalContentAssistParser { // $ANTLR start "rule__ConditionObjet__NombreAssignment_2" - // InternalGame.g:8250:1: rule__ConditionObjet__NombreAssignment_2 : ( RULE_INT ) ; + // InternalGame.g:8258:1: rule__ConditionObjet__NombreAssignment_2 : ( RULE_INT ) ; public final void rule__ConditionObjet__NombreAssignment_2() throws RecognitionException { int stackSize = keepStackSize(); try { - // InternalGame.g:8254:1: ( ( RULE_INT ) ) - // InternalGame.g:8255:2: ( RULE_INT ) + // InternalGame.g:8262:1: ( ( RULE_INT ) ) + // InternalGame.g:8263:2: ( RULE_INT ) { - // InternalGame.g:8255:2: ( RULE_INT ) - // InternalGame.g:8256:3: RULE_INT + // InternalGame.g:8263:2: ( RULE_INT ) + // InternalGame.g:8264:3: RULE_INT { before(grammarAccess.getConditionObjetAccess().getNombreINTTerminalRuleCall_2_0()); match(input,RULE_INT,FOLLOW_2); diff --git a/workspace/fr.n7.game.xtext.tests/xtend-gen/fr/n7/game/xtext/tests/.GameParsingTest.xtendbin b/workspace/fr.n7.game.xtext.tests/xtend-gen/fr/n7/game/xtext/tests/.GameParsingTest.xtendbin index 0b533d7..8d58c8a 100644 Binary files a/workspace/fr.n7.game.xtext.tests/xtend-gen/fr/n7/game/xtext/tests/.GameParsingTest.xtendbin and b/workspace/fr.n7.game.xtext.tests/xtend-gen/fr/n7/game/xtext/tests/.GameParsingTest.xtendbin differ diff --git a/workspace/fr.n7.game.xtext.ui/src-gen/fr/n7/game/xtext/ui/contentassist/AbstractGameProposalProvider.java b/workspace/fr.n7.game.xtext.ui/src-gen/fr/n7/game/xtext/ui/contentassist/AbstractGameProposalProvider.java index 15ca7ee..98489be 100644 --- a/workspace/fr.n7.game.xtext.ui/src-gen/fr/n7/game/xtext/ui/contentassist/AbstractGameProposalProvider.java +++ b/workspace/fr.n7.game.xtext.ui/src-gen/fr/n7/game/xtext/ui/contentassist/AbstractGameProposalProvider.java @@ -211,10 +211,10 @@ public abstract class AbstractGameProposalProvider extends TerminalsProposalProv // subclasses may override } public void completeConditionConnaissance_Connaissance(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); + lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); } public void completeConditionObjet_Objet(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); + lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor); } public void completeConditionObjet_Comparateur(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); diff --git a/workspace/fr.n7.game.xtext/model/generated/Game.ecore b/workspace/fr.n7.game.xtext/model/generated/Game.ecore index cbf2d49..663a371 100644 --- a/workspace/fr.n7.game.xtext/model/generated/Game.ecore +++ b/workspace/fr.n7.game.xtext/model/generated/Game.ecore @@ -145,10 +145,10 @@ - + - + diff --git a/workspace/fr.n7.game.xtext/model/generated/Game.genmodel b/workspace/fr.n7.game.xtext/model/generated/Game.genmodel index eb6c7a5..e8dbb59 100644 --- a/workspace/fr.n7.game.xtext/model/generated/Game.genmodel +++ b/workspace/fr.n7.game.xtext/model/generated/Game.genmodel @@ -102,10 +102,10 @@ - + - + diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/Game.xtextbin b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/Game.xtextbin index 439e779..d09e890 100644 Binary files a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/Game.xtextbin and b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/Game.xtextbin differ diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/ConditionConnaissance.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/ConditionConnaissance.java index db529bd..66408ae 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/ConditionConnaissance.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/ConditionConnaissance.java @@ -46,25 +46,25 @@ public interface ConditionConnaissance extends ConditionTest void setNegation(String value); /** - * Returns the value of the 'Connaissance' attribute. + * Returns the value of the 'Connaissance' reference. * * - * @return the value of the 'Connaissance' attribute. - * @see #setConnaissance(String) + * @return the value of the 'Connaissance' reference. + * @see #setConnaissance(Connaissance) * @see fr.n7.game.xtext.game.GamePackage#getConditionConnaissance_Connaissance() * @model * @generated */ - String getConnaissance(); + Connaissance getConnaissance(); /** - * Sets the value of the '{@link fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance Connaissance}' attribute. + * Sets the value of the '{@link fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance Connaissance}' reference. * * - * @param value the new value of the 'Connaissance' attribute. + * @param value the new value of the 'Connaissance' reference. * @see #getConnaissance() * @generated */ - void setConnaissance(String value); + void setConnaissance(Connaissance value); } // ConditionConnaissance diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/ConditionObjet.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/ConditionObjet.java index c91bc03..6981cff 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/ConditionObjet.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/ConditionObjet.java @@ -25,26 +25,26 @@ package fr.n7.game.xtext.game; public interface ConditionObjet extends ConditionTest { /** - * Returns the value of the 'Objet' attribute. + * Returns the value of the 'Objet' reference. * * - * @return the value of the 'Objet' attribute. - * @see #setObjet(String) + * @return the value of the 'Objet' reference. + * @see #setObjet(Objet) * @see fr.n7.game.xtext.game.GamePackage#getConditionObjet_Objet() * @model * @generated */ - String getObjet(); + Objet getObjet(); /** - * Sets the value of the '{@link fr.n7.game.xtext.game.ConditionObjet#getObjet Objet}' attribute. + * Sets the value of the '{@link fr.n7.game.xtext.game.ConditionObjet#getObjet Objet}' reference. * * - * @param value the new value of the 'Objet' attribute. + * @param value the new value of the 'Objet' reference. * @see #getObjet() * @generated */ - void setObjet(String value); + void setObjet(Objet value); /** * Returns the value of the 'Comparateur' attribute. diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/GamePackage.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/GamePackage.java index c3143e5..843aa88 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/GamePackage.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/GamePackage.java @@ -948,7 +948,7 @@ public interface GamePackage extends EPackage int CONDITION_CONNAISSANCE__NEGATION = CONDITION_TEST_FEATURE_COUNT + 0; /** - * The feature id for the 'Connaissance' attribute. + * The feature id for the 'Connaissance' reference. * * * @generated @@ -976,7 +976,7 @@ public interface GamePackage extends EPackage int CONDITION_OBJET = 17; /** - * The feature id for the 'Objet' attribute. + * The feature id for the 'Objet' reference. * * * @generated @@ -1887,15 +1887,15 @@ public interface GamePackage extends EPackage EAttribute getConditionConnaissance_Negation(); /** - * Returns the meta object for the attribute '{@link fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance Connaissance}'. + * Returns the meta object for the reference '{@link fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance Connaissance}'. * * - * @return the meta object for the attribute 'Connaissance'. + * @return the meta object for the reference 'Connaissance'. * @see fr.n7.game.xtext.game.ConditionConnaissance#getConnaissance() * @see #getConditionConnaissance() * @generated */ - EAttribute getConditionConnaissance_Connaissance(); + EReference getConditionConnaissance_Connaissance(); /** * Returns the meta object for class '{@link fr.n7.game.xtext.game.ConditionObjet Condition Objet}'. @@ -1908,15 +1908,15 @@ public interface GamePackage extends EPackage EClass getConditionObjet(); /** - * Returns the meta object for the attribute '{@link fr.n7.game.xtext.game.ConditionObjet#getObjet Objet}'. + * Returns the meta object for the reference '{@link fr.n7.game.xtext.game.ConditionObjet#getObjet Objet}'. * * - * @return the meta object for the attribute 'Objet'. + * @return the meta object for the reference 'Objet'. * @see fr.n7.game.xtext.game.ConditionObjet#getObjet() * @see #getConditionObjet() * @generated */ - EAttribute getConditionObjet_Objet(); + EReference getConditionObjet_Objet(); /** * Returns the meta object for the attribute '{@link fr.n7.game.xtext.game.ConditionObjet#getComparateur Comparateur}'. @@ -2646,12 +2646,12 @@ public interface GamePackage extends EPackage EAttribute CONDITION_CONNAISSANCE__NEGATION = eINSTANCE.getConditionConnaissance_Negation(); /** - * The meta object literal for the 'Connaissance' attribute feature. + * The meta object literal for the 'Connaissance' reference feature. * * * @generated */ - EAttribute CONDITION_CONNAISSANCE__CONNAISSANCE = eINSTANCE.getConditionConnaissance_Connaissance(); + EReference CONDITION_CONNAISSANCE__CONNAISSANCE = eINSTANCE.getConditionConnaissance_Connaissance(); /** * The meta object literal for the '{@link fr.n7.game.xtext.game.impl.ConditionObjetImpl Condition Objet}' class. @@ -2664,12 +2664,12 @@ public interface GamePackage extends EPackage EClass CONDITION_OBJET = eINSTANCE.getConditionObjet(); /** - * The meta object literal for the 'Objet' attribute feature. + * The meta object literal for the 'Objet' reference feature. * * * @generated */ - EAttribute CONDITION_OBJET__OBJET = eINSTANCE.getConditionObjet_Objet(); + EReference CONDITION_OBJET__OBJET = eINSTANCE.getConditionObjet_Objet(); /** * The meta object literal for the 'Comparateur' attribute feature. diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/ConditionConnaissanceImpl.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/ConditionConnaissanceImpl.java index 7ebaa6b..fea3b76 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/ConditionConnaissanceImpl.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/ConditionConnaissanceImpl.java @@ -4,11 +4,13 @@ package fr.n7.game.xtext.game.impl; import fr.n7.game.xtext.game.ConditionConnaissance; +import fr.n7.game.xtext.game.Connaissance; import fr.n7.game.xtext.game.GamePackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -49,24 +51,14 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond protected String negation = NEGATION_EDEFAULT; /** - * The default value of the '{@link #getConnaissance() Connaissance}' attribute. + * The cached value of the '{@link #getConnaissance() Connaissance}' reference. * * * @see #getConnaissance() * @generated * @ordered */ - protected static final String CONNAISSANCE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getConnaissance() Connaissance}' attribute. - * - * - * @see #getConnaissance() - * @generated - * @ordered - */ - protected String connaissance = CONNAISSANCE_EDEFAULT; + protected Connaissance connaissance; /** * @@ -120,7 +112,27 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond * @generated */ @Override - public String getConnaissance() + public Connaissance getConnaissance() + { + if (connaissance != null && connaissance.eIsProxy()) + { + InternalEObject oldConnaissance = (InternalEObject)connaissance; + connaissance = (Connaissance)eResolveProxy(oldConnaissance); + if (connaissance != oldConnaissance) + { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE, oldConnaissance, connaissance)); + } + } + return connaissance; + } + + /** + * + * + * @generated + */ + public Connaissance basicGetConnaissance() { return connaissance; } @@ -131,9 +143,9 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond * @generated */ @Override - public void setConnaissance(String newConnaissance) + public void setConnaissance(Connaissance newConnaissance) { - String oldConnaissance = connaissance; + Connaissance oldConnaissance = connaissance; connaissance = newConnaissance; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE, oldConnaissance, connaissance)); @@ -152,7 +164,8 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond case GamePackage.CONDITION_CONNAISSANCE__NEGATION: return getNegation(); case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE: - return getConnaissance(); + if (resolve) return getConnaissance(); + return basicGetConnaissance(); } return super.eGet(featureID, resolve, coreType); } @@ -171,7 +184,7 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond setNegation((String)newValue); return; case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE: - setConnaissance((String)newValue); + setConnaissance((Connaissance)newValue); return; } super.eSet(featureID, newValue); @@ -191,7 +204,7 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond setNegation(NEGATION_EDEFAULT); return; case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE: - setConnaissance(CONNAISSANCE_EDEFAULT); + setConnaissance((Connaissance)null); return; } super.eUnset(featureID); @@ -210,7 +223,7 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond case GamePackage.CONDITION_CONNAISSANCE__NEGATION: return NEGATION_EDEFAULT == null ? negation != null : !NEGATION_EDEFAULT.equals(negation); case GamePackage.CONDITION_CONNAISSANCE__CONNAISSANCE: - return CONNAISSANCE_EDEFAULT == null ? connaissance != null : !CONNAISSANCE_EDEFAULT.equals(connaissance); + return connaissance != null; } return super.eIsSet(featureID); } @@ -228,8 +241,6 @@ public class ConditionConnaissanceImpl extends ConditionTestImpl implements Cond StringBuilder result = new StringBuilder(super.toString()); result.append(" (negation: "); result.append(negation); - result.append(", connaissance: "); - result.append(connaissance); result.append(')'); return result.toString(); } diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/ConditionObjetImpl.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/ConditionObjetImpl.java index 4f3e540..b581480 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/ConditionObjetImpl.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/ConditionObjetImpl.java @@ -5,10 +5,12 @@ package fr.n7.game.xtext.game.impl; import fr.n7.game.xtext.game.ConditionObjet; import fr.n7.game.xtext.game.GamePackage; +import fr.n7.game.xtext.game.Objet; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -30,24 +32,14 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; public class ConditionObjetImpl extends ConditionTestImpl implements ConditionObjet { /** - * The default value of the '{@link #getObjet() Objet}' attribute. + * The cached value of the '{@link #getObjet() Objet}' reference. * * * @see #getObjet() * @generated * @ordered */ - protected static final String OBJET_EDEFAULT = null; - - /** - * The cached value of the '{@link #getObjet() Objet}' attribute. - * - * - * @see #getObjet() - * @generated - * @ordered - */ - protected String objet = OBJET_EDEFAULT; + protected Objet objet; /** * The default value of the '{@link #getComparateur() Comparateur}' attribute. @@ -116,7 +108,27 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb * @generated */ @Override - public String getObjet() + public Objet getObjet() + { + if (objet != null && objet.eIsProxy()) + { + InternalEObject oldObjet = (InternalEObject)objet; + objet = (Objet)eResolveProxy(oldObjet); + if (objet != oldObjet) + { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, GamePackage.CONDITION_OBJET__OBJET, oldObjet, objet)); + } + } + return objet; + } + + /** + * + * + * @generated + */ + public Objet basicGetObjet() { return objet; } @@ -127,9 +139,9 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb * @generated */ @Override - public void setObjet(String newObjet) + public void setObjet(Objet newObjet) { - String oldObjet = objet; + Objet oldObjet = objet; objet = newObjet; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, GamePackage.CONDITION_OBJET__OBJET, oldObjet, objet)); @@ -196,7 +208,8 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb switch (featureID) { case GamePackage.CONDITION_OBJET__OBJET: - return getObjet(); + if (resolve) return getObjet(); + return basicGetObjet(); case GamePackage.CONDITION_OBJET__COMPARATEUR: return getComparateur(); case GamePackage.CONDITION_OBJET__NOMBRE: @@ -216,7 +229,7 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb switch (featureID) { case GamePackage.CONDITION_OBJET__OBJET: - setObjet((String)newValue); + setObjet((Objet)newValue); return; case GamePackage.CONDITION_OBJET__COMPARATEUR: setComparateur((String)newValue); @@ -239,7 +252,7 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb switch (featureID) { case GamePackage.CONDITION_OBJET__OBJET: - setObjet(OBJET_EDEFAULT); + setObjet((Objet)null); return; case GamePackage.CONDITION_OBJET__COMPARATEUR: setComparateur(COMPARATEUR_EDEFAULT); @@ -262,7 +275,7 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb switch (featureID) { case GamePackage.CONDITION_OBJET__OBJET: - return OBJET_EDEFAULT == null ? objet != null : !OBJET_EDEFAULT.equals(objet); + return objet != null; case GamePackage.CONDITION_OBJET__COMPARATEUR: return COMPARATEUR_EDEFAULT == null ? comparateur != null : !COMPARATEUR_EDEFAULT.equals(comparateur); case GamePackage.CONDITION_OBJET__NOMBRE: @@ -282,9 +295,7 @@ public class ConditionObjetImpl extends ConditionTestImpl implements ConditionOb if (eIsProxy()) return super.toString(); StringBuilder result = new StringBuilder(super.toString()); - result.append(" (objet: "); - result.append(objet); - result.append(", comparateur: "); + result.append(" (comparateur: "); result.append(comparateur); result.append(", nombre: "); result.append(nombre); diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/GamePackageImpl.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/GamePackageImpl.java index cc5ba4b..2999fc1 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/GamePackageImpl.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/game/impl/GamePackageImpl.java @@ -1125,9 +1125,9 @@ public class GamePackageImpl extends EPackageImpl implements GamePackage * @generated */ @Override - public EAttribute getConditionConnaissance_Connaissance() + public EReference getConditionConnaissance_Connaissance() { - return (EAttribute)conditionConnaissanceEClass.getEStructuralFeatures().get(1); + return (EReference)conditionConnaissanceEClass.getEStructuralFeatures().get(1); } /** @@ -1147,9 +1147,9 @@ public class GamePackageImpl extends EPackageImpl implements GamePackage * @generated */ @Override - public EAttribute getConditionObjet_Objet() + public EReference getConditionObjet_Objet() { - return (EAttribute)conditionObjetEClass.getEStructuralFeatures().get(0); + return (EReference)conditionObjetEClass.getEStructuralFeatures().get(0); } /** @@ -1302,10 +1302,10 @@ public class GamePackageImpl extends EPackageImpl implements GamePackage conditionConnaissanceEClass = createEClass(CONDITION_CONNAISSANCE); createEAttribute(conditionConnaissanceEClass, CONDITION_CONNAISSANCE__NEGATION); - createEAttribute(conditionConnaissanceEClass, CONDITION_CONNAISSANCE__CONNAISSANCE); + createEReference(conditionConnaissanceEClass, CONDITION_CONNAISSANCE__CONNAISSANCE); conditionObjetEClass = createEClass(CONDITION_OBJET); - createEAttribute(conditionObjetEClass, CONDITION_OBJET__OBJET); + createEReference(conditionObjetEClass, CONDITION_OBJET__OBJET); createEAttribute(conditionObjetEClass, CONDITION_OBJET__COMPARATEUR); createEAttribute(conditionObjetEClass, CONDITION_OBJET__NOMBRE); } @@ -1441,10 +1441,10 @@ public class GamePackageImpl extends EPackageImpl implements GamePackage initEClass(conditionConnaissanceEClass, ConditionConnaissance.class, "ConditionConnaissance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getConditionConnaissance_Negation(), ecorePackage.getEString(), "negation", null, 0, 1, ConditionConnaissance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getConditionConnaissance_Connaissance(), ecorePackage.getEString(), "connaissance", null, 0, 1, ConditionConnaissance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getConditionConnaissance_Connaissance(), this.getConnaissance(), null, "connaissance", null, 0, 1, ConditionConnaissance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(conditionObjetEClass, ConditionObjet.class, "ConditionObjet", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getConditionObjet_Objet(), ecorePackage.getEString(), "objet", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getConditionObjet_Objet(), this.getObjet(), null, "objet", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConditionObjet_Comparateur(), ecorePackage.getEString(), "comparateur", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getConditionObjet_Nombre(), ecorePackage.getEInt(), "nombre", null, 0, 1, ConditionObjet.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGame.g b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGame.g index 3bc2abc..bbae9f2 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGame.g +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGame.g @@ -2171,19 +2171,14 @@ ruleConditionConnaissance returns [EObject current=null] )? ( ( - lv_connaissance_1_0=RULE_ID - { - newLeafNode(lv_connaissance_1_0, grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); - } { if ($current==null) { $current = createModelElement(grammarAccess.getConditionConnaissanceRule()); } - setWithLastConsumed( - $current, - "connaissance", - lv_connaissance_1_0, - "org.eclipse.xtext.common.Terminals.ID"); + } + otherlv_1=RULE_ID + { + newLeafNode(otherlv_1, grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0()); } ) ) @@ -2208,19 +2203,14 @@ ruleConditionObjet returns [EObject current=null] ( ( ( - lv_objet_0_0=RULE_ID - { - newLeafNode(lv_objet_0_0, grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); - } { if ($current==null) { $current = createModelElement(grammarAccess.getConditionObjetRule()); } - setWithLastConsumed( - $current, - "objet", - lv_objet_0_0, - "org.eclipse.xtext.common.Terminals.ID"); + } + otherlv_0=RULE_ID + { + newLeafNode(otherlv_0, grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0()); } ) ) diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGameLexer.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGameLexer.java index 57b12f7..4179722 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGameLexer.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGameLexer.java @@ -808,10 +808,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_COMPARATEUR; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2266:18: ( ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) ) - // InternalGame.g:2266:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) + // InternalGame.g:2256:18: ( ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) ) + // InternalGame.g:2256:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) { - // InternalGame.g:2266:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) + // InternalGame.g:2256:20: ( '<' | '>' | '==' | '<=' | '>=' | '!=' ) int alt1=6; switch ( input.LA(1) ) { case '<': @@ -855,21 +855,21 @@ public class InternalGameLexer extends Lexer { switch (alt1) { case 1 : - // InternalGame.g:2266:21: '<' + // InternalGame.g:2256:21: '<' { match('<'); } break; case 2 : - // InternalGame.g:2266:25: '>' + // InternalGame.g:2256:25: '>' { match('>'); } break; case 3 : - // InternalGame.g:2266:29: '==' + // InternalGame.g:2256:29: '==' { match("=="); @@ -877,7 +877,7 @@ public class InternalGameLexer extends Lexer { } break; case 4 : - // InternalGame.g:2266:34: '<=' + // InternalGame.g:2256:34: '<=' { match("<="); @@ -885,7 +885,7 @@ public class InternalGameLexer extends Lexer { } break; case 5 : - // InternalGame.g:2266:39: '>=' + // InternalGame.g:2256:39: '>=' { match(">="); @@ -893,7 +893,7 @@ public class InternalGameLexer extends Lexer { } break; case 6 : - // InternalGame.g:2266:44: '!=' + // InternalGame.g:2256:44: '!=' { match("!="); @@ -919,10 +919,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_BOOLEAN; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2268:14: ( ( 'true' | 'false' ) ) - // InternalGame.g:2268:16: ( 'true' | 'false' ) + // InternalGame.g:2258:14: ( ( 'true' | 'false' ) ) + // InternalGame.g:2258:16: ( 'true' | 'false' ) { - // InternalGame.g:2268:16: ( 'true' | 'false' ) + // InternalGame.g:2258:16: ( 'true' | 'false' ) int alt2=2; int LA2_0 = input.LA(1); @@ -940,7 +940,7 @@ public class InternalGameLexer extends Lexer { } switch (alt2) { case 1 : - // InternalGame.g:2268:17: 'true' + // InternalGame.g:2258:17: 'true' { match("true"); @@ -948,7 +948,7 @@ public class InternalGameLexer extends Lexer { } break; case 2 : - // InternalGame.g:2268:24: 'false' + // InternalGame.g:2258:24: 'false' { match("false"); @@ -974,10 +974,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_ID; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2270:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // InternalGame.g:2270:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalGame.g:2260:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) + // InternalGame.g:2260:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* { - // InternalGame.g:2270:11: ( '^' )? + // InternalGame.g:2260:11: ( '^' )? int alt3=2; int LA3_0 = input.LA(1); @@ -986,7 +986,7 @@ public class InternalGameLexer extends Lexer { } switch (alt3) { case 1 : - // InternalGame.g:2270:11: '^' + // InternalGame.g:2260:11: '^' { match('^'); @@ -1004,7 +1004,7 @@ public class InternalGameLexer extends Lexer { recover(mse); throw mse;} - // InternalGame.g:2270:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* + // InternalGame.g:2260:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* loop4: do { int alt4=2; @@ -1053,10 +1053,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_INT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2272:10: ( ( '0' .. '9' )+ ) - // InternalGame.g:2272:12: ( '0' .. '9' )+ + // InternalGame.g:2262:10: ( ( '0' .. '9' )+ ) + // InternalGame.g:2262:12: ( '0' .. '9' )+ { - // InternalGame.g:2272:12: ( '0' .. '9' )+ + // InternalGame.g:2262:12: ( '0' .. '9' )+ int cnt5=0; loop5: do { @@ -1070,7 +1070,7 @@ public class InternalGameLexer extends Lexer { switch (alt5) { case 1 : - // InternalGame.g:2272:13: '0' .. '9' + // InternalGame.g:2262:13: '0' .. '9' { matchRange('0','9'); @@ -1102,10 +1102,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_STRING; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2274:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // InternalGame.g:2274:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalGame.g:2264:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) + // InternalGame.g:2264:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) { - // InternalGame.g:2274:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) + // InternalGame.g:2264:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) int alt8=2; int LA8_0 = input.LA(1); @@ -1123,10 +1123,10 @@ public class InternalGameLexer extends Lexer { } switch (alt8) { case 1 : - // InternalGame.g:2274:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' + // InternalGame.g:2264:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' { match('\"'); - // InternalGame.g:2274:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* + // InternalGame.g:2264:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* loop6: do { int alt6=3; @@ -1142,7 +1142,7 @@ public class InternalGameLexer extends Lexer { switch (alt6) { case 1 : - // InternalGame.g:2274:21: '\\\\' . + // InternalGame.g:2264:21: '\\\\' . { match('\\'); matchAny(); @@ -1150,7 +1150,7 @@ public class InternalGameLexer extends Lexer { } break; case 2 : - // InternalGame.g:2274:28: ~ ( ( '\\\\' | '\"' ) ) + // InternalGame.g:2264:28: ~ ( ( '\\\\' | '\"' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -1175,10 +1175,10 @@ public class InternalGameLexer extends Lexer { } break; case 2 : - // InternalGame.g:2274:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' + // InternalGame.g:2264:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' { match('\''); - // InternalGame.g:2274:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* + // InternalGame.g:2264:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* loop7: do { int alt7=3; @@ -1194,7 +1194,7 @@ public class InternalGameLexer extends Lexer { switch (alt7) { case 1 : - // InternalGame.g:2274:54: '\\\\' . + // InternalGame.g:2264:54: '\\\\' . { match('\\'); matchAny(); @@ -1202,7 +1202,7 @@ public class InternalGameLexer extends Lexer { } break; case 2 : - // InternalGame.g:2274:61: ~ ( ( '\\\\' | '\\'' ) ) + // InternalGame.g:2264:61: ~ ( ( '\\\\' | '\\'' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -1245,12 +1245,12 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_ML_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2276:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // InternalGame.g:2276:19: '/*' ( options {greedy=false; } : . )* '*/' + // InternalGame.g:2266:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) + // InternalGame.g:2266:19: '/*' ( options {greedy=false; } : . )* '*/' { match("/*"); - // InternalGame.g:2276:24: ( options {greedy=false; } : . )* + // InternalGame.g:2266:24: ( options {greedy=false; } : . )* loop9: do { int alt9=2; @@ -1275,7 +1275,7 @@ public class InternalGameLexer extends Lexer { switch (alt9) { case 1 : - // InternalGame.g:2276:52: . + // InternalGame.g:2266:52: . { matchAny(); @@ -1305,12 +1305,12 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_SL_COMMENT; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2278:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // InternalGame.g:2278:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? + // InternalGame.g:2268:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) + // InternalGame.g:2268:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? { match("//"); - // InternalGame.g:2278:24: (~ ( ( '\\n' | '\\r' ) ) )* + // InternalGame.g:2268:24: (~ ( ( '\\n' | '\\r' ) ) )* loop10: do { int alt10=2; @@ -1323,7 +1323,7 @@ public class InternalGameLexer extends Lexer { switch (alt10) { case 1 : - // InternalGame.g:2278:24: ~ ( ( '\\n' | '\\r' ) ) + // InternalGame.g:2268:24: ~ ( ( '\\n' | '\\r' ) ) { if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { input.consume(); @@ -1343,7 +1343,7 @@ public class InternalGameLexer extends Lexer { } } while (true); - // InternalGame.g:2278:40: ( ( '\\r' )? '\\n' )? + // InternalGame.g:2268:40: ( ( '\\r' )? '\\n' )? int alt12=2; int LA12_0 = input.LA(1); @@ -1352,9 +1352,9 @@ public class InternalGameLexer extends Lexer { } switch (alt12) { case 1 : - // InternalGame.g:2278:41: ( '\\r' )? '\\n' + // InternalGame.g:2268:41: ( '\\r' )? '\\n' { - // InternalGame.g:2278:41: ( '\\r' )? + // InternalGame.g:2268:41: ( '\\r' )? int alt11=2; int LA11_0 = input.LA(1); @@ -1363,7 +1363,7 @@ public class InternalGameLexer extends Lexer { } switch (alt11) { case 1 : - // InternalGame.g:2278:41: '\\r' + // InternalGame.g:2268:41: '\\r' { match('\r'); @@ -1395,10 +1395,10 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_WS; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2280:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // InternalGame.g:2280:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalGame.g:2270:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) + // InternalGame.g:2270:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ { - // InternalGame.g:2280:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ + // InternalGame.g:2270:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ int cnt13=0; loop13: do { @@ -1452,8 +1452,8 @@ public class InternalGameLexer extends Lexer { try { int _type = RULE_ANY_OTHER; int _channel = DEFAULT_TOKEN_CHANNEL; - // InternalGame.g:2282:16: ( . ) - // InternalGame.g:2282:18: . + // InternalGame.g:2272:16: ( . ) + // InternalGame.g:2272:18: . { matchAny(); diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGameParser.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGameParser.java index 4ddf2d9..e1633f4 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGameParser.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/parser/antlr/internal/InternalGameParser.java @@ -4872,22 +4872,22 @@ public class InternalGameParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleConditionConnaissance" - // InternalGame.g:2150:1: ruleConditionConnaissance returns [EObject current=null] : ( ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) ) ; + // InternalGame.g:2150:1: ruleConditionConnaissance returns [EObject current=null] : ( ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) ) ; public final EObject ruleConditionConnaissance() throws RecognitionException { EObject current = null; Token lv_negation_0_0=null; - Token lv_connaissance_1_0=null; + Token otherlv_1=null; enterRule(); try { - // InternalGame.g:2156:2: ( ( ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) ) ) - // InternalGame.g:2157:2: ( ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) ) + // InternalGame.g:2156:2: ( ( ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) ) ) + // InternalGame.g:2157:2: ( ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) ) { - // InternalGame.g:2157:2: ( ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) ) - // InternalGame.g:2158:3: ( (lv_negation_0_0= '!' ) )? ( (lv_connaissance_1_0= RULE_ID ) ) + // InternalGame.g:2157:2: ( ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) ) + // InternalGame.g:2158:3: ( (lv_negation_0_0= '!' ) )? ( (otherlv_1= RULE_ID ) ) { // InternalGame.g:2158:3: ( (lv_negation_0_0= '!' ) )? int alt33=2; @@ -4922,25 +4922,20 @@ public class InternalGameParser extends AbstractInternalAntlrParser { } - // InternalGame.g:2172:3: ( (lv_connaissance_1_0= RULE_ID ) ) - // InternalGame.g:2173:4: (lv_connaissance_1_0= RULE_ID ) + // InternalGame.g:2172:3: ( (otherlv_1= RULE_ID ) ) + // InternalGame.g:2173:4: (otherlv_1= RULE_ID ) { - // InternalGame.g:2173:4: (lv_connaissance_1_0= RULE_ID ) - // InternalGame.g:2174:5: lv_connaissance_1_0= RULE_ID + // InternalGame.g:2173:4: (otherlv_1= RULE_ID ) + // InternalGame.g:2174:5: otherlv_1= RULE_ID { - lv_connaissance_1_0=(Token)match(input,RULE_ID,FOLLOW_2); - - newLeafNode(lv_connaissance_1_0, grammarAccess.getConditionConnaissanceAccess().getConnaissanceIDTerminalRuleCall_1_0()); - if (current==null) { current = createModelElement(grammarAccess.getConditionConnaissanceRule()); } - setWithLastConsumed( - current, - "connaissance", - lv_connaissance_1_0, - "org.eclipse.xtext.common.Terminals.ID"); + + otherlv_1=(Token)match(input,RULE_ID,FOLLOW_2); + + newLeafNode(otherlv_1, grammarAccess.getConditionConnaissanceAccess().getConnaissanceConnaissanceCrossReference_1_0()); } @@ -4971,7 +4966,7 @@ public class InternalGameParser extends AbstractInternalAntlrParser { // $ANTLR start "entryRuleConditionObjet" - // InternalGame.g:2194:1: entryRuleConditionObjet returns [EObject current=null] : iv_ruleConditionObjet= ruleConditionObjet EOF ; + // InternalGame.g:2189:1: entryRuleConditionObjet returns [EObject current=null] : iv_ruleConditionObjet= ruleConditionObjet EOF ; public final EObject entryRuleConditionObjet() throws RecognitionException { EObject current = null; @@ -4979,8 +4974,8 @@ public class InternalGameParser extends AbstractInternalAntlrParser { try { - // InternalGame.g:2194:55: (iv_ruleConditionObjet= ruleConditionObjet EOF ) - // InternalGame.g:2195:2: iv_ruleConditionObjet= ruleConditionObjet EOF + // InternalGame.g:2189:55: (iv_ruleConditionObjet= ruleConditionObjet EOF ) + // InternalGame.g:2190:2: iv_ruleConditionObjet= ruleConditionObjet EOF { newCompositeNode(grammarAccess.getConditionObjetRule()); pushFollow(FOLLOW_1); @@ -5007,11 +5002,11 @@ public class InternalGameParser extends AbstractInternalAntlrParser { // $ANTLR start "ruleConditionObjet" - // InternalGame.g:2201:1: ruleConditionObjet returns [EObject current=null] : ( ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) ; + // InternalGame.g:2196:1: ruleConditionObjet returns [EObject current=null] : ( ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) ; public final EObject ruleConditionObjet() throws RecognitionException { EObject current = null; - Token lv_objet_0_0=null; + Token otherlv_0=null; Token lv_comparateur_1_0=null; Token lv_nombre_2_0=null; @@ -5019,31 +5014,26 @@ public class InternalGameParser extends AbstractInternalAntlrParser { enterRule(); try { - // InternalGame.g:2207:2: ( ( ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) ) - // InternalGame.g:2208:2: ( ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) + // InternalGame.g:2202:2: ( ( ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) ) + // InternalGame.g:2203:2: ( ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) { - // InternalGame.g:2208:2: ( ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) - // InternalGame.g:2209:3: ( (lv_objet_0_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) + // InternalGame.g:2203:2: ( ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) ) + // InternalGame.g:2204:3: ( (otherlv_0= RULE_ID ) ) ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) ( (lv_nombre_2_0= RULE_INT ) ) { - // InternalGame.g:2209:3: ( (lv_objet_0_0= RULE_ID ) ) - // InternalGame.g:2210:4: (lv_objet_0_0= RULE_ID ) + // InternalGame.g:2204:3: ( (otherlv_0= RULE_ID ) ) + // InternalGame.g:2205:4: (otherlv_0= RULE_ID ) { - // InternalGame.g:2210:4: (lv_objet_0_0= RULE_ID ) - // InternalGame.g:2211:5: lv_objet_0_0= RULE_ID + // InternalGame.g:2205:4: (otherlv_0= RULE_ID ) + // InternalGame.g:2206:5: otherlv_0= RULE_ID { - lv_objet_0_0=(Token)match(input,RULE_ID,FOLLOW_43); - - newLeafNode(lv_objet_0_0, grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0()); - if (current==null) { current = createModelElement(grammarAccess.getConditionObjetRule()); } - setWithLastConsumed( - current, - "objet", - lv_objet_0_0, - "org.eclipse.xtext.common.Terminals.ID"); + + otherlv_0=(Token)match(input,RULE_ID,FOLLOW_43); + + newLeafNode(otherlv_0, grammarAccess.getConditionObjetAccess().getObjetObjetCrossReference_0_0()); } @@ -5051,11 +5041,11 @@ public class InternalGameParser extends AbstractInternalAntlrParser { } - // InternalGame.g:2227:3: ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) - // InternalGame.g:2228:4: (lv_comparateur_1_0= RULE_COMPARATEUR ) + // InternalGame.g:2217:3: ( (lv_comparateur_1_0= RULE_COMPARATEUR ) ) + // InternalGame.g:2218:4: (lv_comparateur_1_0= RULE_COMPARATEUR ) { - // InternalGame.g:2228:4: (lv_comparateur_1_0= RULE_COMPARATEUR ) - // InternalGame.g:2229:5: lv_comparateur_1_0= RULE_COMPARATEUR + // InternalGame.g:2218:4: (lv_comparateur_1_0= RULE_COMPARATEUR ) + // InternalGame.g:2219:5: lv_comparateur_1_0= RULE_COMPARATEUR { lv_comparateur_1_0=(Token)match(input,RULE_COMPARATEUR,FOLLOW_12); @@ -5077,11 +5067,11 @@ public class InternalGameParser extends AbstractInternalAntlrParser { } - // InternalGame.g:2245:3: ( (lv_nombre_2_0= RULE_INT ) ) - // InternalGame.g:2246:4: (lv_nombre_2_0= RULE_INT ) + // InternalGame.g:2235:3: ( (lv_nombre_2_0= RULE_INT ) ) + // InternalGame.g:2236:4: (lv_nombre_2_0= RULE_INT ) { - // InternalGame.g:2246:4: (lv_nombre_2_0= RULE_INT ) - // InternalGame.g:2247:5: lv_nombre_2_0= RULE_INT + // InternalGame.g:2236:4: (lv_nombre_2_0= RULE_INT ) + // InternalGame.g:2237:5: lv_nombre_2_0= RULE_INT { lv_nombre_2_0=(Token)match(input,RULE_INT,FOLLOW_2); diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/serializer/GameSemanticSequencer.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/serializer/GameSemanticSequencer.java index 24386e6..e3e4de6 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/serializer/GameSemanticSequencer.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/serializer/GameSemanticSequencer.java @@ -171,7 +171,7 @@ public class GameSemanticSequencer extends AbstractDelegatingSemanticSequencer { * ConditionConnaissance returns ConditionConnaissance * * Constraint: - * (negation='!'? connaissance=ID) + * (negation='!'? connaissance=[Connaissance|ID]) */ protected void sequence_ConditionConnaissance(ISerializationContext context, ConditionConnaissance semanticObject) { genericSequencer.createSequence(context, semanticObject); @@ -196,7 +196,7 @@ public class GameSemanticSequencer extends AbstractDelegatingSemanticSequencer { * ConditionObjet returns ConditionObjet * * Constraint: - * (objet=ID comparateur=COMPARATEUR nombre=INT) + * (objet=[Objet|ID] comparateur=COMPARATEUR nombre=INT) */ protected void sequence_ConditionObjet(ISerializationContext context, ConditionObjet semanticObject) { if (errorAcceptor != null) { @@ -208,7 +208,7 @@ public class GameSemanticSequencer extends AbstractDelegatingSemanticSequencer { errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, GamePackage.Literals.CONDITION_OBJET__NOMBRE)); } SequenceFeeder feeder = createSequencerFeeder(context, semanticObject); - feeder.accept(grammarAccess.getConditionObjetAccess().getObjetIDTerminalRuleCall_0_0(), semanticObject.getObjet()); + feeder.accept(grammarAccess.getConditionObjetAccess().getObjetObjetIDTerminalRuleCall_0_0_1(), semanticObject.eGet(GamePackage.Literals.CONDITION_OBJET__OBJET, false)); feeder.accept(grammarAccess.getConditionObjetAccess().getComparateurCOMPARATEURTerminalRuleCall_1_0(), semanticObject.getComparateur()); feeder.accept(grammarAccess.getConditionObjetAccess().getNombreINTTerminalRuleCall_2_0(), semanticObject.getNombre()); feeder.finish(); diff --git a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/services/GameGrammarAccess.java b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/services/GameGrammarAccess.java index 5e77df6..7c82662 100644 --- a/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/services/GameGrammarAccess.java +++ b/workspace/fr.n7.game.xtext/src-gen/fr/n7/game/xtext/services/GameGrammarAccess.java @@ -1564,13 +1564,14 @@ public class GameGrammarAccess extends AbstractElementFinder.AbstractGrammarElem private final Assignment cNegationAssignment_0 = (Assignment)cGroup.eContents().get(0); private final Keyword cNegationExclamationMarkKeyword_0_0 = (Keyword)cNegationAssignment_0.eContents().get(0); private final Assignment cConnaissanceAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cConnaissanceIDTerminalRuleCall_1_0 = (RuleCall)cConnaissanceAssignment_1.eContents().get(0); + private final CrossReference cConnaissanceConnaissanceCrossReference_1_0 = (CrossReference)cConnaissanceAssignment_1.eContents().get(0); + private final RuleCall cConnaissanceConnaissanceIDTerminalRuleCall_1_0_1 = (RuleCall)cConnaissanceConnaissanceCrossReference_1_0.eContents().get(1); //ConditionConnaissance: - // negation='!'? connaissance=ID; + // negation='!'? connaissance=[Connaissance]; @Override public ParserRule getRule() { return rule; } - //negation='!'? connaissance=ID + //negation='!'? connaissance=[Connaissance] public Group getGroup() { return cGroup; } //negation='!'? @@ -1579,34 +1580,41 @@ public class GameGrammarAccess extends AbstractElementFinder.AbstractGrammarElem //'!' public Keyword getNegationExclamationMarkKeyword_0_0() { return cNegationExclamationMarkKeyword_0_0; } - //connaissance=ID + //connaissance=[Connaissance] public Assignment getConnaissanceAssignment_1() { return cConnaissanceAssignment_1; } + //[Connaissance] + public CrossReference getConnaissanceConnaissanceCrossReference_1_0() { return cConnaissanceConnaissanceCrossReference_1_0; } + //ID - public RuleCall getConnaissanceIDTerminalRuleCall_1_0() { return cConnaissanceIDTerminalRuleCall_1_0; } + public RuleCall getConnaissanceConnaissanceIDTerminalRuleCall_1_0_1() { return cConnaissanceConnaissanceIDTerminalRuleCall_1_0_1; } } public class ConditionObjetElements extends AbstractParserRuleElementFinder { private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "fr.n7.game.xtext.Game.ConditionObjet"); private final Group cGroup = (Group)rule.eContents().get(1); private final Assignment cObjetAssignment_0 = (Assignment)cGroup.eContents().get(0); - private final RuleCall cObjetIDTerminalRuleCall_0_0 = (RuleCall)cObjetAssignment_0.eContents().get(0); + private final CrossReference cObjetObjetCrossReference_0_0 = (CrossReference)cObjetAssignment_0.eContents().get(0); + private final RuleCall cObjetObjetIDTerminalRuleCall_0_0_1 = (RuleCall)cObjetObjetCrossReference_0_0.eContents().get(1); private final Assignment cComparateurAssignment_1 = (Assignment)cGroup.eContents().get(1); private final RuleCall cComparateurCOMPARATEURTerminalRuleCall_1_0 = (RuleCall)cComparateurAssignment_1.eContents().get(0); private final Assignment cNombreAssignment_2 = (Assignment)cGroup.eContents().get(2); private final RuleCall cNombreINTTerminalRuleCall_2_0 = (RuleCall)cNombreAssignment_2.eContents().get(0); //ConditionObjet: - // objet=ID comparateur=COMPARATEUR nombre=INT; + // objet=[Objet] comparateur=COMPARATEUR nombre=INT; @Override public ParserRule getRule() { return rule; } - //objet=ID comparateur=COMPARATEUR nombre=INT + //objet=[Objet] comparateur=COMPARATEUR nombre=INT public Group getGroup() { return cGroup; } - //objet=ID + //objet=[Objet] public Assignment getObjetAssignment_0() { return cObjetAssignment_0; } + //[Objet] + public CrossReference getObjetObjetCrossReference_0_0() { return cObjetObjetCrossReference_0_0; } + //ID - public RuleCall getObjetIDTerminalRuleCall_0_0() { return cObjetIDTerminalRuleCall_0_0; } + public RuleCall getObjetObjetIDTerminalRuleCall_0_0_1() { return cObjetObjetIDTerminalRuleCall_0_0_1; } //comparateur=COMPARATEUR public Assignment getComparateurAssignment_1() { return cComparateurAssignment_1; } @@ -1911,7 +1919,7 @@ public class GameGrammarAccess extends AbstractElementFinder.AbstractGrammarElem } //ConditionConnaissance: - // negation='!'? connaissance=ID; + // negation='!'? connaissance=[Connaissance]; public ConditionConnaissanceElements getConditionConnaissanceAccess() { return pConditionConnaissance; } @@ -1921,7 +1929,7 @@ public class GameGrammarAccess extends AbstractElementFinder.AbstractGrammarElem } //ConditionObjet: - // objet=ID comparateur=COMPARATEUR nombre=INT; + // objet=[Objet] comparateur=COMPARATEUR nombre=INT; public ConditionObjetElements getConditionObjetAccess() { return pConditionObjet; } diff --git a/workspace/fr.n7.game.xtext/src/fr/n7/game/xtext/Game.xtext b/workspace/fr.n7.game.xtext/src/fr/n7/game/xtext/Game.xtext index 80a548e..ecd6239 100644 --- a/workspace/fr.n7.game.xtext/src/fr/n7/game/xtext/Game.xtext +++ b/workspace/fr.n7.game.xtext/src/fr/n7/game/xtext/Game.xtext @@ -115,11 +115,11 @@ ConditionBoolean: ; ConditionConnaissance: - (negation='!')? connaissance=ID + (negation='!')? connaissance=[Connaissance] ; ConditionObjet: - objet=ID comparateur=COMPARATEUR nombre=INT + objet=[Objet] comparateur=COMPARATEUR nombre=INT ; terminal COMPARATEUR: diff --git a/workspace/fr.n7.game.xtext/xtend-gen/fr/n7/game/xtext/generator/.GameGenerator.xtendbin b/workspace/fr.n7.game.xtext/xtend-gen/fr/n7/game/xtext/generator/.GameGenerator.xtendbin index 8baf878..ea0cc79 100644 Binary files a/workspace/fr.n7.game.xtext/xtend-gen/fr/n7/game/xtext/generator/.GameGenerator.xtendbin and b/workspace/fr.n7.game.xtext/xtend-gen/fr/n7/game/xtext/generator/.GameGenerator.xtendbin differ