From 36d55796741a7bdc330e2baac847aabf5fbd466f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20N=C3=A9grel-Jerzy?= Date: Fri, 10 Dec 2021 15:13:39 +0100 Subject: [PATCH] feat: setup Sirius project no assets defined yet --- workspace/fr.n7.game.design/.classpath | 7 + workspace/fr.n7.game.design/.project | 24 +++ .../fr.n7.game.design/META-INF/MANIFEST.MF | 16 ++ workspace/fr.n7.game.design/build.properties | 7 + .../description/game.odesign | 10 + workspace/fr.n7.game.design/enigme.game | 174 ++++++++++++++++++ workspace/fr.n7.game.design/plugin.properties | 3 + workspace/fr.n7.game.design/plugin.xml | 10 + .../src/fr/n7/game/design/Activator.java | 66 +++++++ .../src/fr/n7/game/design/Services.java | 17 ++ workspace/fr.n7.game.samples/.project | 18 ++ workspace/fr.n7.game.samples/enigme.game | 174 ++++++++++++++++++ .../fr.n7.game.samples/representations.aird | 7 + 13 files changed, 533 insertions(+) create mode 100644 workspace/fr.n7.game.design/.classpath create mode 100644 workspace/fr.n7.game.design/.project create mode 100644 workspace/fr.n7.game.design/META-INF/MANIFEST.MF create mode 100644 workspace/fr.n7.game.design/build.properties create mode 100644 workspace/fr.n7.game.design/description/game.odesign create mode 100644 workspace/fr.n7.game.design/enigme.game create mode 100644 workspace/fr.n7.game.design/plugin.properties create mode 100644 workspace/fr.n7.game.design/plugin.xml create mode 100644 workspace/fr.n7.game.design/src/fr/n7/game/design/Activator.java create mode 100644 workspace/fr.n7.game.design/src/fr/n7/game/design/Services.java create mode 100644 workspace/fr.n7.game.samples/.project create mode 100644 workspace/fr.n7.game.samples/enigme.game create mode 100644 workspace/fr.n7.game.samples/representations.aird diff --git a/workspace/fr.n7.game.design/.classpath b/workspace/fr.n7.game.design/.classpath new file mode 100644 index 0000000..39810b7 --- /dev/null +++ b/workspace/fr.n7.game.design/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/workspace/fr.n7.game.design/.project b/workspace/fr.n7.game.design/.project new file mode 100644 index 0000000..3257a6d --- /dev/null +++ b/workspace/fr.n7.game.design/.project @@ -0,0 +1,24 @@ + + + fr.n7.game.design + + + + + org.eclipse.jdt.core.javabuilder + + + + org.eclipse.pde.ManifestBuilder + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/workspace/fr.n7.game.design/META-INF/MANIFEST.MF b/workspace/fr.n7.game.design/META-INF/MANIFEST.MF new file mode 100644 index 0000000..693feaa --- /dev/null +++ b/workspace/fr.n7.game.design/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: fr.n7.game.design;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: fr.n7.game.design.Activator +Bundle-Localization: plugin +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.sirius, + org.eclipse.sirius.common.acceleo.aql +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-Vendor: %providerName +Automatic-Module-Name: fr.n7.game.design diff --git a/workspace/fr.n7.game.design/build.properties b/workspace/fr.n7.game.design/build.properties new file mode 100644 index 0000000..1ab7df2 --- /dev/null +++ b/workspace/fr.n7.game.design/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + description/,\ + plugin.properties,\ + plugin.xml diff --git a/workspace/fr.n7.game.design/description/game.odesign b/workspace/fr.n7.game.design/description/game.odesign new file mode 100644 index 0000000..1e1f8ed --- /dev/null +++ b/workspace/fr.n7.game.design/description/game.odesign @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/workspace/fr.n7.game.design/enigme.game b/workspace/fr.n7.game.design/enigme.game new file mode 100644 index 0000000..8880ec9 --- /dev/null +++ b/workspace/fr.n7.game.design/enigme.game @@ -0,0 +1,174 @@ +{ + "Explorateur": { + "taille": 3, + "connaissances": [], + "objets": [ + "tentative", + "tentative", + "tentative" + ] + }, + "Territoire": { + "Lieux": [ + { + "nom": "Enigme", + "deposable": true, + "depart": true, + "fin": false, + "personnes": [ + "Sphinx" + ], + "descriptions": [ + { + "texte": "lieu de depart", + "condition": true + } + ], + "objets": [], + "connaissances": [] + }, + { + "nom": "Succes", + "deposable": false, + "depart": false, + "fin": true, + "personnes": [], + "descriptions": [ + { + "texte": "lieu succes", + "condition": true + } + ], + "objets": [], + "connaissances": [] + }, + { + "nom": "Echec", + "deposable": false, + "depart": false, + "fin": true, + "personnes": [], + "descriptions": [ + { + "texte": "lieu echec", + "condition": true + } + ], + "objets": [], + "connaissances": [] + } + ], + "Chemins": [ + { + "nom": "win", + "lieu_in": "Enigme", + "lieu_out": "Succes", + "ouvert": true, + "visible": Reussite, + "obligatoire": true, + "connaissances": [], + "objets_recus": [], + "objets_conso": [], + "descriptions": [ + { + "texte": "Le chemin de la victoire !", + "condition": true + } + ] + }, + { + "nom": "loose", + "lieu_in": "Enigme", + "lieu_out": "Echec", + "ouvert": true, + "visible": tentatives == 0, + "obligatoire": true, + "connaissances": [], + "objets_recus": [], + "objets_conso": [], + "descriptions": [ + { + "texte": "Le chemin de la loose !", + "condition": true + } + ] + } + ] + }, + "Objets": [ + { + "nom": "tentative", + "taille": 1, + "visible": true, + "descriptions": [ + { + "texte": "permet repondre une question du sphinx", + "condition": true + } + ] + } + ], + "Connaissances": [ + { + "nom": "Reussite", + "visible": true, + "descriptions": [ + { + "texte": "Permet de se casser de la", + "condition": true + } + ] + } + ], + "Personnes": [ + { + "nom": "Sphinx", + "visible": ! Reussite && tentative > 0, + "obligatoire": true, + "interactions": [ + { + "nom": "Parler", + "visible": true, + "connaissances": [], + "objets_recus": [], + "objets_conso": [], + "actions": [ + { + "nom": "Reponse_1", + "visible": true, + "fin_interaction": true, + "connaissances": [ + "Reussite" + ], + "objets_recus": [], + "objets_conso": [], + "descriptions" : [ + { + "texte": "la bonne reponse", + "condition": true + } + ] + }, + { + "nom": "Reponse_2", + "visible": true, + "fin_interaction": true, + "connaissances": [], + "objets_recus": [], + "objets_conso": [ + "tentative" + ], + "descriptions" : [ + { + "texte": "la mauvaise reponse", + "condition": true + } + ] + } + ] + } + ] + } + ], + "Transformations": [] +} \ No newline at end of file diff --git a/workspace/fr.n7.game.design/plugin.properties b/workspace/fr.n7.game.design/plugin.properties new file mode 100644 index 0000000..fef353f --- /dev/null +++ b/workspace/fr.n7.game.design/plugin.properties @@ -0,0 +1,3 @@ +pluginName = fr.n7.game.design +providerName = Eclipse Modeling Project +viewpointName = MyViewpoint diff --git a/workspace/fr.n7.game.design/plugin.xml b/workspace/fr.n7.game.design/plugin.xml new file mode 100644 index 0000000..86965a0 --- /dev/null +++ b/workspace/fr.n7.game.design/plugin.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/workspace/fr.n7.game.design/src/fr/n7/game/design/Activator.java b/workspace/fr.n7.game.design/src/fr/n7/game/design/Activator.java new file mode 100644 index 0000000..dcf6fcd --- /dev/null +++ b/workspace/fr.n7.game.design/src/fr/n7/game/design/Activator.java @@ -0,0 +1,66 @@ +package fr.n7.game.design; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.sirius.business.api.componentization.ViewpointRegistry; +import org.eclipse.sirius.viewpoint.description.Viewpoint; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + // The plug-in ID + public static final String PLUGIN_ID = "fr.n7.game.design"; + + // The shared instance + private static Activator plugin; + + private static Set viewpoints; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + viewpoints = new HashSet(); + viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN_ID + "/description/game.odesign")); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + if (viewpoints != null) { + for (final Viewpoint viewpoint: viewpoints) { + ViewpointRegistry.getInstance().disposeFromPlugin(viewpoint); + } + viewpoints.clear(); + viewpoints = null; + } + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/workspace/fr.n7.game.design/src/fr/n7/game/design/Services.java b/workspace/fr.n7.game.design/src/fr/n7/game/design/Services.java new file mode 100644 index 0000000..c953c30 --- /dev/null +++ b/workspace/fr.n7.game.design/src/fr/n7/game/design/Services.java @@ -0,0 +1,17 @@ +package fr.n7.game.design; + +import org.eclipse.emf.ecore.EObject; + +/** + * The services class used by VSM. + */ +public class Services { + + /** + * See http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.sirius.doc%2Fdoc%2Findex.html&cp=24 for documentation on how to write service methods. + */ + public EObject myService(EObject self, String arg) { + // TODO Auto-generated code + return self; + } +} diff --git a/workspace/fr.n7.game.samples/.project b/workspace/fr.n7.game.samples/.project new file mode 100644 index 0000000..4983b22 --- /dev/null +++ b/workspace/fr.n7.game.samples/.project @@ -0,0 +1,18 @@ + + + fr.n7.game.samples + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.eclipse.sirius.nature.modelingproject + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/workspace/fr.n7.game.samples/enigme.game b/workspace/fr.n7.game.samples/enigme.game new file mode 100644 index 0000000..8880ec9 --- /dev/null +++ b/workspace/fr.n7.game.samples/enigme.game @@ -0,0 +1,174 @@ +{ + "Explorateur": { + "taille": 3, + "connaissances": [], + "objets": [ + "tentative", + "tentative", + "tentative" + ] + }, + "Territoire": { + "Lieux": [ + { + "nom": "Enigme", + "deposable": true, + "depart": true, + "fin": false, + "personnes": [ + "Sphinx" + ], + "descriptions": [ + { + "texte": "lieu de depart", + "condition": true + } + ], + "objets": [], + "connaissances": [] + }, + { + "nom": "Succes", + "deposable": false, + "depart": false, + "fin": true, + "personnes": [], + "descriptions": [ + { + "texte": "lieu succes", + "condition": true + } + ], + "objets": [], + "connaissances": [] + }, + { + "nom": "Echec", + "deposable": false, + "depart": false, + "fin": true, + "personnes": [], + "descriptions": [ + { + "texte": "lieu echec", + "condition": true + } + ], + "objets": [], + "connaissances": [] + } + ], + "Chemins": [ + { + "nom": "win", + "lieu_in": "Enigme", + "lieu_out": "Succes", + "ouvert": true, + "visible": Reussite, + "obligatoire": true, + "connaissances": [], + "objets_recus": [], + "objets_conso": [], + "descriptions": [ + { + "texte": "Le chemin de la victoire !", + "condition": true + } + ] + }, + { + "nom": "loose", + "lieu_in": "Enigme", + "lieu_out": "Echec", + "ouvert": true, + "visible": tentatives == 0, + "obligatoire": true, + "connaissances": [], + "objets_recus": [], + "objets_conso": [], + "descriptions": [ + { + "texte": "Le chemin de la loose !", + "condition": true + } + ] + } + ] + }, + "Objets": [ + { + "nom": "tentative", + "taille": 1, + "visible": true, + "descriptions": [ + { + "texte": "permet repondre une question du sphinx", + "condition": true + } + ] + } + ], + "Connaissances": [ + { + "nom": "Reussite", + "visible": true, + "descriptions": [ + { + "texte": "Permet de se casser de la", + "condition": true + } + ] + } + ], + "Personnes": [ + { + "nom": "Sphinx", + "visible": ! Reussite && tentative > 0, + "obligatoire": true, + "interactions": [ + { + "nom": "Parler", + "visible": true, + "connaissances": [], + "objets_recus": [], + "objets_conso": [], + "actions": [ + { + "nom": "Reponse_1", + "visible": true, + "fin_interaction": true, + "connaissances": [ + "Reussite" + ], + "objets_recus": [], + "objets_conso": [], + "descriptions" : [ + { + "texte": "la bonne reponse", + "condition": true + } + ] + }, + { + "nom": "Reponse_2", + "visible": true, + "fin_interaction": true, + "connaissances": [], + "objets_recus": [], + "objets_conso": [ + "tentative" + ], + "descriptions" : [ + { + "texte": "la mauvaise reponse", + "condition": true + } + ] + } + ] + } + ] + } + ], + "Transformations": [] +} \ No newline at end of file diff --git a/workspace/fr.n7.game.samples/representations.aird b/workspace/fr.n7.game.samples/representations.aird new file mode 100644 index 0000000..fbd418f --- /dev/null +++ b/workspace/fr.n7.game.samples/representations.aird @@ -0,0 +1,7 @@ + + + enigme.game + + + +