diff --git a/code/PtiClic/src/org/pticlic/model/GamePlayed.java b/code/PtiClic/src/org/pticlic/model/GamePlayed.java index e43507d..7b14bad 100644 --- a/code/PtiClic/src/org/pticlic/model/GamePlayed.java +++ b/code/PtiClic/src/org/pticlic/model/GamePlayed.java @@ -13,20 +13,20 @@ import java.util.ArrayList; */ public class GamePlayed implements Serializable { - private static final long serialVersionUID = 1L; - private ArrayList relation1; - private ArrayList relation2; - private ArrayList relation3; - private ArrayList relation4; - private ArrayList poubelle; - private DownloadedGame game; + private static final long serialVersionUID = 1L; + private ArrayList relation1; + private ArrayList relation2; + private ArrayList relation3; + private ArrayList relation4; + private ArrayList trash; + private DownloadedGame game; public GamePlayed() { - relation1 = new ArrayList(); - relation2 = new ArrayList(); - relation3 = new ArrayList(); - relation4 = new ArrayList(); - poubelle = new ArrayList(); + relation1 = new ArrayList(); + relation2 = new ArrayList(); + relation3 = new ArrayList(); + relation4 = new ArrayList(); + trash = new ArrayList(); } public void setGame(DownloadedGame game) { @@ -37,13 +37,85 @@ public class GamePlayed implements Serializable { return game; } - public void add(int relation, CharSequence word) { + public void add(int relation, String word) { switch (relation) { case 1: relation1.add(word); break; case 2: relation2.add(word); break; case 3: relation3.add(word); break; case 4: relation4.add(word); break; - default: poubelle.add(word); break; + default: trash.add(word); break; } } + + /** + * @return the relation1 + */ + public ArrayList getRelation1() { + return relation1; + } + + /** + * @return the relation2 + */ + public ArrayList getRelation2() { + return relation2; + } + + /** + * @return the relation3 + */ + public ArrayList getRelation3() { + return relation3; + } + + /** + * @return the relation4 + */ + public ArrayList getRelation4() { + return relation4; + } + + /** + * @return the trash + */ + public ArrayList getTrash() { + return trash; + } + + /** + * @param relation1 the relation1 to set + */ + public void setRelation1(ArrayList relation1) { + this.relation1 = relation1; + } + + /** + * @param relation2 the relation2 to set + */ + public void setRelation2(ArrayList relation2) { + this.relation2 = relation2; + } + + /** + * @param relation3 the relation3 to set + */ + public void setRelation3(ArrayList relation3) { + this.relation3 = relation3; + } + + /** + * @param relation4 the relation4 to set + */ + public void setRelation4(ArrayList relation4) { + this.relation4 = relation4; + } + + /** + * @param trash the trash to set + */ + public void setTrash(ArrayList trash) { + this.trash = trash; + } + + } diff --git a/code/PtiClic/src/org/pticlic/model/Network.java b/code/PtiClic/src/org/pticlic/model/Network.java index d82f68d..1148140 100644 --- a/code/PtiClic/src/org/pticlic/model/Network.java +++ b/code/PtiClic/src/org/pticlic/model/Network.java @@ -82,7 +82,7 @@ public class Network { reader.close(); } catch (IOException e) { e.printStackTrace(); - + return null; } @@ -148,6 +148,20 @@ public class Network { connection.addRequestProperty("passwd", this.passwd); connection.addRequestProperty("mode", mode.value()); + if (game.getGame().getCat1() != -1) { +// for (game.getRelation1()) +// connection.addRequestProperty("cat1[]", newValue); + } + if (game.getGame().getCat2() != -1) { + + } + if (game.getGame().getCat3() != -1) { + + } + if (game.getGame().getCat4() != -1) { + + } + Gson gson = new Gson(); String json = gson.toJson(game);