diff --git a/code/PtiClic/src/org/pticlic/model/Game.java b/code/PtiClic/src/org/pticlic/model/Game.java new file mode 100644 index 0000000..963bde1 --- /dev/null +++ b/code/PtiClic/src/org/pticlic/model/Game.java @@ -0,0 +1,128 @@ +package org.pticlic.model; + + +public class Game { + + static class Word { + private int id; + private String name; + + public Word() {} + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + private int id; + private int cat1; + private int cat2; + private int cat3; + private int cat4; + private Word center; + private Game.Word[] cloud; + + public Game() { + cloud = new Game.Word[3]; + } + + public int getNbRelation() { + int res = 0; + + if (cat1 != -1) { + res++; + } + if (cat2 != -1) { + res++; + } + if (cat3 != -1) { + res++; + } + if (cat4 != -1) { + res++; + } + + return res; + } + + public static String getName(Word word) { + return word.getName(); + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getCat1() { + return cat1; + } + + public void setCat1(int cat1) { + this.cat1 = cat1; + } + + public int getCat2() { + return cat2; + } + + public void setCat2(int cat2) { + this.cat2 = cat2; + } + + public int getCat3() { + return cat3; + } + + public void setCat3(int cat3) { + this.cat3 = cat3; + } + + public int getCat4() { + return cat4; + } + + public void setCat4(int cat4) { + this.cat4 = cat4; + } + + public Word getCentre() { + return center; + } + + public void setCentre(Word center) { + this.center = center; + } + + public Game.Word[] getCloud() { + return cloud; + } + + public void setCloud(Game.Word[] cloud) { + this.cloud = cloud; + } + + @Override + public String toString() { + return "Game [id=" + id + ", cat1=" + cat1 + ", cat2=" + cat2 + + ", cat3=" + cat3 + ", cat4=" + cat4 + ", center=" + center + + ", cloud=" + cloud + "]"; + } + + +} diff --git a/code/PtiClic/src/org/pticlic/model/GamePlayed.java b/code/PtiClic/src/org/pticlic/model/GamePlayed.java deleted file mode 100644 index 73f0ba1..0000000 --- a/code/PtiClic/src/org/pticlic/model/GamePlayed.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.pticlic.model; - -public class GamePlayed { - -}