Commit a6e492c3 authored by LucMerceron's avatar LucMerceron
Browse files

Oups, Scuzy

parent 1fcb544f
android
\ No newline at end of file
Resume
\ No newline at end of file
......@@ -3,7 +3,7 @@
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>
......
......@@ -2,7 +2,7 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/android.iml" filepath="$PROJECT_DIR$/android.iml" />
<module fileurl="file://$PROJECT_DIR$/Resume.iml" filepath="$PROJECT_DIR$/Resume.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
......
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="android" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Resume" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
......@@ -80,11 +80,11 @@
</content>
<orderEntry type="jdk" jdkName="Android API 20 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="ion-1.4.1" level="project" />
<orderEntry type="library" exported="" name="androidasync-1.4.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-20.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-20.0.0" level="project" />
<orderEntry type="library" exported="" name="ion-1.4.1" level="project" />
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-20.0.0" level="project" />
</component>
</module>
......@@ -6,6 +6,8 @@ import android.os.Bundle;
import android.view.View;
import fr.istic.masteru.android.R;
import fr.istic.masteru.android.automate.Automate;
import fr.istic.masteru.android.automate.FileManager;
public class HomeActivity extends Activity {
......@@ -23,7 +25,6 @@ public class HomeActivity extends Activity {
findViewById(R.id.resumeMatchButton).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// todo ResumeMatchActivity
}
});
}
......
......@@ -7,6 +7,8 @@ public interface Automate {
public Score point(int code);
public Score point2(int code);
public Score getPoint(int index);
public Score back();
......
......@@ -58,6 +58,29 @@ public class AutomateDouble implements Automate {
return score.getScore();
}
@Override
public Score point2(int code) {
/** Vérification TieBreak */
if (!DoublePoint.getScore().isTieBreak()) {
/** Vérification SuperTieBreak */
if (!DoublePoint.getScore().isSuperTieBreak()) {
numact = DoublePoint.action[etat][code];
etat = DoublePoint.transit[etat][code];
score = DoublePoint.executer(numact).copy();
} else {
score = DoublePoint.executer(20 + code).copy();
}
} else {
score = DoublePoint.executer(10 + code).copy();
}
/* Ajout de l'état dans une pile d'état */
pileEtat.add(etat);
/* Ajout de score dans un vecteur de score */
pile.add(score.copy());
return score.getScore();
}
@Override
public Score getPoint(int index) {
return pile.elementAt(index).getScore();
......
......@@ -53,6 +53,25 @@ public class AutomateDoublePro implements Automate {
return score.getScore();
}
@Override
public Score point2(int code) {
/** Vérification TieBreak */
if (!DoubleProPoint.getScore().isTieBreak()) {
numact = DoubleProPoint.action[etat][code];
etat = DoubleProPoint.transit[etat][code];
score = DoubleProPoint.executer(numact).copy();
} else {
score = DoubleProPoint.executer(10 + code).copy();
}
/* Ajout de l'état dans une pile d'état */
pileEtat.add(etat);
/* Ajout de score dans un vecteur de score */
pile.add(score);
return score.getScore();
}
@Override
public Score getPoint(int index) {
return pile.elementAt(index).getScore();
......
......@@ -55,6 +55,25 @@ public class AutomateSimple implements Automate {
return score.getScore();
}
public Score point2(int code) {
/** Vérification TieBreak */
if (!SimplePoint.getScore().isTieBreak()) {
numact = SimplePoint.action[etat][code];
etat = SimplePoint.transit[etat][code];
score = SimplePoint.executer(numact).copy();
} else {
score = SimplePoint.executer(10 + code).copy();
}
/* Ajout de l'état dans une pile d'état */
pileEtat.add(etat);
/* Ajout de score dans un vecteur de score */
pile.add(score);
return score.getScore();
}
@Override
public Score getPoint(int index) {
return pile.elementAt(index).getScore();
......
......@@ -42,17 +42,18 @@ public class FileManager {
/* Initialiser un nouvel automate */
public static Automate importAutomate(Context context) {
String s;
char automate;
Automate aut;
int service, side, first, second, res;
s = ReadScore(context);
String s = ReadScore(context);
automate = s.charAt(0);
service = Character.getNumericValue(s.charAt(1));
side = Character.getNumericValue(s.charAt(2));
first = Character.getNumericValue(s.charAt(3));
second = Character.getNumericValue(s.charAt(4));
res = first + second;
res = (first * 10) + second;
if (automate == 'S') {
aut = new AutomateSimple(service, ((side == 1) ? true : false), Integer.valueOf(res), false);
......@@ -61,9 +62,9 @@ public class FileManager {
} else {
aut = new AutomateDoublePro(service, ((side == 1) ? true : false), Integer.valueOf(res), false);
}
for (int i = 5; i < s.length(); i++) {
Toast.makeText(context, "Point " + Character.getNumericValue(s.charAt(i)), Toast.LENGTH_SHORT).show();
aut.point(Character.getNumericValue(s.charAt(i)));
aut.point2(Character.getNumericValue(s.charAt(i)));
}
return aut;
......@@ -120,7 +121,7 @@ public class FileManager {
FileReader fileReader;
BufferedReader bufferedReader;
File file;
String data = new String();
String data = null;
if (isExternalStorageWritable()) {
file = getDocumentsStorageDir(context, "save.txt");
......
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