Ajout GSON v0.1 à finir de debug
parent
61fec1a10b
commit
6611a5b65f
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry excluding="src/" kind="src" path=""/>
|
||||
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/gson">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="/home/nicolas/Téléchargements"/>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/nicolas/Téléchargements/gson-2.8.5.jar">
|
||||
<attributes>
|
||||
<attribute name="module" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/nicolas/Bureau/java-json.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>projet</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,12 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=10
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=10
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=10
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,28 @@
|
||||
package json;
|
||||
import modeles.*;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
public class gsonGenerator {
|
||||
String chaineJson;
|
||||
|
||||
/**
|
||||
* @param chaineJson
|
||||
*/
|
||||
public gsonGenerator() {
|
||||
|
||||
|
||||
}
|
||||
/*chaine json =
|
||||
"{'positionX':0,
|
||||
'positionY':0,
|
||||
'sortie':false,
|
||||
'monstre':[{'nom':premier monstre,'pAttaque':5}],
|
||||
'porte':[{'ouvert':=true, 'position':"H"}]}"
|
||||
*/
|
||||
public void generate(String chaine) {
|
||||
Gson gson = new Gson();
|
||||
Salle salle = gson.fromJson(chaine, Salle.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package json;
|
||||
|
||||
|
||||
import modeles.Monstre;
|
||||
|
||||
public class main {
|
||||
|
||||
public static void main(String[] args) {
|
||||
gsonGenerator generateur = new gsonGenerator();
|
||||
Monstre monstr = new Monstre("test", 5);
|
||||
String chaine = "{'positionX':0,'positionY':0,'sortie':false,'monstre':[{'nom':'premier monstre','pAttaque':5}],'porte':[{'ouvert':true, 'position':'H'}]}";
|
||||
generateur.generate(chaine);
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* @author nicolas
|
||||
*
|
||||
*/
|
||||
module projet {
|
||||
requires gson;
|
||||
|
||||
}
|
Loading…
Reference in New Issue