commit 546f105223b590b4662c4bafde4cba0a0591e17f
parent 97e18f69efe860977e9fa149bffc7cc3265d57c2
Author: Bertrand BRUN <bertrand0brun@gmail.com>
Date: Mon, 31 Jan 2011 21:23:42 +0100
Correction d'un probleme lors du lancement de l'activite Score
Diffstat:
3 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/code/PtiClic/src/org/pticlic/Score.java b/code/PtiClic/src/org/pticlic/Score.java
@@ -10,7 +10,7 @@ import android.view.View;
import android.view.View.OnClickListener;
public class Score extends Activity implements OnClickListener{
- private GamePlayed gamePlayed;
+ private GamePlayed gamePlayed;
@Override
diff --git a/code/PtiClic/src/org/pticlic/games/BaseGame.java b/code/PtiClic/src/org/pticlic/games/BaseGame.java
@@ -23,10 +23,10 @@ import android.widget.Button;
import android.widget.TextView;
public class BaseGame extends Activity implements OnClickListener {
- private int currentWord = 0;
- private int nbWord = 0;
- private Game game;
- private GamePlayed gamePlayed;
+ private int currentWord = 0;
+ private int nbWord = 0;
+ private Game game;
+ private GamePlayed gamePlayed;
/** Called when the activity is first created. */
@Override
@@ -112,12 +112,12 @@ public class BaseGame extends Activity implements OnClickListener {
* Permet de verifier si la partie est fini auquel cas on lance l'activite Score, sinon on passe au mot suivant.
*/
private void next() {
- if (currentWord < nbWord) {
- currentWord++;
+ if (++currentWord < nbWord) {
start();
} else {
Intent intent = new Intent(this, Score.class);
intent.putExtra(Constant.SCORE_INTENT, gamePlayed);
+ startActivity(intent);
}
}
diff --git a/code/PtiClic/src/org/pticlic/model/Game.java b/code/PtiClic/src/org/pticlic/model/Game.java
@@ -1,9 +1,15 @@
package org.pticlic.model;
+import java.io.Serializable;
-public class Game {
- public static class Word {
+public class Game implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public static class Word implements Serializable {
+
+ private static final long serialVersionUID = 1L;
private int id;
private String name;
@@ -25,13 +31,13 @@ public class Game {
this.name = name;
}
}
-
- private int id;
- private int cat1;
- private int cat2;
- private int cat3;
- private int cat4;
- private Word center;
+
+ private int id;
+ private int cat1;
+ private int cat2;
+ private int cat3;
+ private int cat4;
+ private Word center;
private Game.Word[] cloud;
public Game() {