Commit dcbe99e7 authored by rakam's avatar rakam

fix a stupid bug in AutomateSimple and AutomateDoublePro

parent 86f29d41
......@@ -143,28 +143,28 @@ public class AutomateDoublePro implements Automate {
@Override
public Point switchSide() {
Stats stat=null;
Stats stat = null;
Score score1 = null;
InfoScore infoScore;
Point point = null;
Step step = null;
/* Modifier l'état du score de l'automate */
DoublePoint.score.setSideLeftA(!DoublePoint.score.isSideLeftA());
DoubleProPoint.score.setSideLeftA(!DoubleProPoint.score.isSideLeftA());
/* Modifier l'état dans le fichier et la pile */
step = pile.get(pile.size() -1);
step = pile.get(pile.size() - 1);
infoScore = step.getInfoScore().copy();
if(step.getStats()!=null) {
if (step.getStats() != null) {
stat = step.getStats().copy();
}
infoScore.setSideLeftA(!infoScore.isSideLeftA());
step = new Step(infoScore,stat);
step = new Step(infoScore, stat);
pile.setElementAt(step, pile.size()-1);
pile.setElementAt(step, pile.size() - 1);
point = new Point(infoScore.getScore(),stat);
point = new Point(infoScore.getScore(), stat);
FileManager.deleteLast(context);
FileManager.point(context, point);
......@@ -174,29 +174,29 @@ public class AutomateDoublePro implements Automate {
@Override
public Point switchService() {
Stats stat=null;
Stats stat = null;
Score score1 = null;
InfoScore infoScore;
Point point = null;
Step step = null;
/* Modifier l'état du score de l'automate */
DoublePoint.score.setService((DoublePoint.score.getService() + 1) % 2);
DoubleProPoint.score.setService((DoubleProPoint.score.getService() + 1) % 2);
/* Modifier l'état dans le fichier et la pile */
step = pile.get(pile.size() -1);
step = pile.get(pile.size() - 1);
infoScore = step.getInfoScore().copy();
if(step.getStats()!=null) {
if (step.getStats() != null) {
stat = step.getStats().copy();
}
infoScore.setService((infoScore.getService() + 1) % 2);
step = new Step(infoScore,stat);
step = new Step(infoScore, stat);
pile.setElementAt(step, pile.size()-1);
pile.setElementAt(step, pile.size() - 1);
point = new Point(infoScore.getScore(),stat);
point = new Point(infoScore.getScore(), stat);
FileManager.deleteLast(context);
FileManager.point(context, point);
......
......@@ -144,28 +144,28 @@ public class AutomateSimple implements Automate {
@Override
public Point switchSide() {
Stats stat=null;
Stats stat = null;
Score score1 = null;
InfoScore infoScore;
Point point = null;
Step step = null;
/* Modifier l'état du score de l'automate */
DoublePoint.score.setSideLeftA(!DoublePoint.score.isSideLeftA());
SimplePoint.score.setSideLeftA(!SimplePoint.score.isSideLeftA());
/* Modifier l'état dans le fichier et la pile */
step = pile.get(pile.size() -1);
step = pile.get(pile.size() - 1);
infoScore = step.getInfoScore().copy();
if(step.getStats()!=null) {
if (step.getStats() != null) {
stat = step.getStats().copy();
}
infoScore.setSideLeftA(!infoScore.isSideLeftA());
step = new Step(infoScore,stat);
step = new Step(infoScore, stat);
pile.setElementAt(step, pile.size()-1);
pile.setElementAt(step, pile.size() - 1);
point = new Point(infoScore.getScore(),stat);
point = new Point(infoScore.getScore(), stat);
FileManager.deleteLast(context);
FileManager.point(context, point);
......@@ -175,29 +175,29 @@ public class AutomateSimple implements Automate {
@Override
public Point switchService() {
Stats stat=null;
Stats stat = null;
Score score1 = null;
InfoScore infoScore;
Point point = null;
Step step = null;
/* Modifier l'état du score de l'automate */
DoublePoint.score.setService((DoublePoint.score.getService() + 1) % 2);
SimplePoint.score.setService((SimplePoint.score.getService() + 1) % 2);
/* Modifier l'état dans le fichier et la pile */
step = pile.get(pile.size() -1);
step = pile.get(pile.size() - 1);
infoScore = step.getInfoScore().copy();
if(step.getStats()!=null) {
if (step.getStats() != null) {
stat = step.getStats().copy();
}
infoScore.setService((infoScore.getService() + 1) % 2);
step = new Step(infoScore,stat);
step = new Step(infoScore, stat);
pile.setElementAt(step, pile.size()-1);
pile.setElementAt(step, pile.size() - 1);
point = new Point(infoScore.getScore(),stat);
point = new Point(infoScore.getScore(), stat);
FileManager.deleteLast(context);
FileManager.point(context, point);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment