Commit 9b17e0d9 authored by LucMerceron's avatar LucMerceron

Correction changement Côté & Service

parent ddc53b7e
......@@ -2,6 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/MasterU.iml" filepath="$PROJECT_DIR$/MasterU.iml" />
<module fileurl="file://$PROJECT_DIR$/android.iml" filepath="$PROJECT_DIR$/android.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
......
......@@ -2,7 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
......@@ -9,7 +9,6 @@
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" />
......@@ -86,10 +85,10 @@
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="androidasync-2.1.2" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.0" level="project" />
<orderEntry type="library" exported="" name="ion-2.1.2" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.0" level="project" />
</component>
</module>
......@@ -152,20 +152,22 @@ public class AutomateDouble implements Automate {
@Override
public Point switchSide() {
Stats stat = null;
Score score = null;
InfoScore infoScore = null;
Stats stat = new Stats();
Score score1 = null;
InfoScore infoScore = new InfoScore();
Point point = null;
Step step = null;
/* Modifier l'état du score actuel */
this.score.setSideLeftA(!this.score.isSideLeftA());
/* Modifier l'état dans la pile */
/* Modifier l'état dans la pile */
step = pile.get(pile.size() -1);
infoScore = step.getInfoScore();
stat = step.getStats();
infoScore = step.getInfoScore().copy();
stat = step.getStats().copy();
infoScore.setSideLeftA(!infoScore.isSideLeftA());
step = new Step(infoScore,stat);
......@@ -182,9 +184,9 @@ public class AutomateDouble implements Automate {
@Override
public Point switchService() {
Stats stat = null;
Stats stat = new Stats();
Score score1 = null;
InfoScore infoScore = null;
InfoScore infoScore = new InfoScore();
Point point = null;
Step step = null;
......@@ -194,9 +196,11 @@ public class AutomateDouble implements Automate {
/* Modifier l'état dans la pile */
step = pile.get(pile.size() -1);
infoScore = step.getInfoScore();
stat = step.getStats();
infoScore = step.getInfoScore().copy();
stat = step.getStats().copy();
infoScore.setFirstService((infoScore.getFirstService() + 1) % 2);
step = new Step(infoScore,stat);
pile.setElementAt(step, pile.size()-1);
......
......@@ -142,20 +142,22 @@ public class AutomateDoublePro implements Automate {
@Override
public Point switchSide() {
Stats stat = null;
Score score = null;
InfoScore infoScore = null;
Stats stat = new Stats();
Score score1 = null;
InfoScore infoScore = new InfoScore();
Point point = null;
Step step = null;
/* Modifier l'état du score actuel */
this.score.setSideLeftA(!this.score.isSideLeftA());
/* Modifier l'état dans la pile */
/* Modifier l'état dans la pile */
step = pile.get(pile.size() -1);
infoScore = step.getInfoScore();
stat = step.getStats();
infoScore = step.getInfoScore().copy();
stat = step.getStats().copy();
infoScore.setSideLeftA(!infoScore.isSideLeftA());
step = new Step(infoScore,stat);
......@@ -172,9 +174,9 @@ public class AutomateDoublePro implements Automate {
@Override
public Point switchService() {
Stats stat = null;
Stats stat = new Stats();
Score score1 = null;
InfoScore infoScore = null;
InfoScore infoScore = new InfoScore();
Point point = null;
Step step = null;
......@@ -184,9 +186,11 @@ public class AutomateDoublePro implements Automate {
/* Modifier l'état dans la pile */
step = pile.get(pile.size() -1);
infoScore = step.getInfoScore();
stat = step.getStats();
infoScore = step.getInfoScore().copy();
stat = step.getStats().copy();
infoScore.setFirstService((infoScore.getFirstService() + 1) % 2);
step = new Step(infoScore,stat);
pile.setElementAt(step, pile.size()-1);
......
......@@ -143,20 +143,22 @@ public class AutomateSimple implements Automate {
@Override
public Point switchSide() {
Stats stat = null;
Score score = null;
InfoScore infoScore = null;
Stats stat = new Stats();
Score score1 = null;
InfoScore infoScore = new InfoScore();
Point point = null;
Step step = null;
/* Modifier l'état du score actuel */
this.score.setSideLeftA(!this.score.isSideLeftA());
/* Modifier l'état dans la pile */
/* Modifier l'état dans la pile */
step = pile.get(pile.size() -1);
infoScore = step.getInfoScore();
stat = step.getStats();
infoScore = step.getInfoScore().copy();
stat = step.getStats().copy();
infoScore.setSideLeftA(!infoScore.isSideLeftA());
step = new Step(infoScore,stat);
......@@ -173,9 +175,9 @@ public class AutomateSimple implements Automate {
@Override
public Point switchService() {
Stats stat = null;
Stats stat = new Stats();
Score score1 = null;
InfoScore infoScore = null;
InfoScore infoScore = new InfoScore();
Point point = null;
Step step = null;
......@@ -185,9 +187,11 @@ public class AutomateSimple implements Automate {
/* Modifier l'état dans la pile */
step = pile.get(pile.size() -1);
infoScore = step.getInfoScore();
stat = step.getStats();
infoScore = step.getInfoScore().copy();
stat = step.getStats().copy();
infoScore.setFirstService((infoScore.getFirstService() + 1) % 2);
step = new Step(infoScore,stat);
pile.setElementAt(step, pile.size()-1);
......
......@@ -17,6 +17,12 @@ public class Stats {
private boolean breakPoint;
private int winner;
public Stats() {
this.type = Type.NONE;
this.fsf = false;
this.winner = -1;
}
public Stats(Type type, boolean fsf, int winner) {
this.type = type;
this.fsf = fsf;
......@@ -55,6 +61,10 @@ public class Stats {
this.breakPoint = breakPoint;
}
public Stats copy(){
return new Stats(this.type,this.fsf,this.winner);
}
public String getBackupString() {
StringBuilder builder = new StringBuilder();
builder.append("!");
......
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