From e0df7287571ebad7fcc5d16a2d756b3b2c25fc81 Mon Sep 17 00:00:00 2001 From: chaignea Date: Sat, 8 Apr 2023 15:30:51 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20=C3=A9cran=20fin=20de=20partie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../7.5/executionHistory/executionHistory.bin | Bin 975205 -> 1182076 bytes .../executionHistory/executionHistory.lock | Bin 17 -> 17 bytes .gradle/7.5/fileHashes/fileHashes.bin | Bin 72665 -> 73565 bytes .gradle/7.5/fileHashes/fileHashes.lock | Bin 17 -> 17 bytes .../7.5/fileHashes/resourceHashesCache.bin | Bin 19891 -> 20435 bytes .../buildOutputCleanup.lock | Bin 17 -> 17 bytes app/src/main/AndroidManifest.xml | 3 + .../mastermind/FinDePartieActivity.java | 48 +++++++++++ .../mastermind/MasterMindActivity.java | 44 ++++++---- .../res/layout/activity_fin_de_partie.xml | 81 ++++++++++++++++++ app/src/main/res/values/dimens.xml | 2 + 11 files changed, 161 insertions(+), 17 deletions(-) create mode 100644 app/src/main/java/com/example/mastermind/FinDePartieActivity.java create mode 100644 app/src/main/res/layout/activity_fin_de_partie.xml diff --git a/.gradle/7.5/executionHistory/executionHistory.bin b/.gradle/7.5/executionHistory/executionHistory.bin index 3ab242052d4c95b330f7690dbbd4e40fc0efc282..1309a75138df0a34d109d5b83274d37a9f359680 100644 GIT binary patch delta 5458 zcmb_g2~-nT7oM36l3-?-074RE5fH_Nk^};Ap)R6hq|Cx5pe-Qu>1(7BPSH1e^^Wm1R3qpjF~NB2r~BUowwG9pm~9sF`haIf_$XZcv|7)n23RTm%i%oHE)2H8mKj?%Ou3gi$SF?xJovS*>J;%T!+*IH47Blb%3Uvc-@xqaQ z5H!?pcZ?z~+COGRsDGqf94(Jt<+Mr^5*_Lk6}(cj8)9aXUs_|E5ZD|nb-@-)k~xVK zA_t+rKq3*#mdTtPMG}RhTSELT80QvTT`L=I^2q`^yFX z4k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0ab1102e9c950dc7f5df12178bf23dc2..31aa84ab79a9ef4e23f94e6c14e1acd7938854d2 100644 GIT binary patch literal 17 VcmZP$F`c)6-~Z@+3}C?32LL&-1y}$8 literal 17 VcmZP$F`c)6-~Z@+3}C={82~x-1)Kl? diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7ea4ffe..5fd120f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -14,6 +14,9 @@ + diff --git a/app/src/main/java/com/example/mastermind/FinDePartieActivity.java b/app/src/main/java/com/example/mastermind/FinDePartieActivity.java new file mode 100644 index 0000000..0610754 --- /dev/null +++ b/app/src/main/java/com/example/mastermind/FinDePartieActivity.java @@ -0,0 +1,48 @@ +package com.example.mastermind; + +import android.content.Intent; +import android.os.Bundle; +import android.widget.TextView; + +import androidx.appcompat.app.AppCompatActivity; + +import com.example.mastermind.vue.mastermind.UnePiece; + +public class FinDePartieActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_fin_de_partie); + + boolean trouve = getIntent().getBooleanExtra("trouve", false); + int[] code = getIntent().getIntArrayExtra("code"); + int tours = getIntent().getIntExtra("tour", 0); + + if (trouve){ + ((TextView)findViewById(R.id.texte_gagnant)).setText("Victoire de l'attaquant"); + } else { + ((TextView)findViewById(R.id.texte_gagnant)).setText("Victoire du défenseur"); + } + + ((UnePiece)findViewById(R.id.reponse_code1)).setColor(code[0]); + ((UnePiece)findViewById(R.id.reponse_code2)).setColor(code[1]); + ((UnePiece)findViewById(R.id.reponse_code3)).setColor(code[2]); + ((UnePiece)findViewById(R.id.reponse_code4)).setColor(code[3]); + + if (trouve) { + if (tours == 0) { + ((TextView)findViewById(R.id.texte_nombre_coups)).setText("Le défenseur a trouvé le code en 1 tentative"); + } else { + ((TextView)findViewById(R.id.texte_nombre_coups)).setText("Le défenseur a trouvé le code en " + (tours+1) + " tentatives"); + } + } + } + + @Override + public void onBackPressed() { + Intent menu=new Intent(this, MenuActivity.class); + this.startActivity(menu); + this.finish(); + } +} diff --git a/app/src/main/java/com/example/mastermind/MasterMindActivity.java b/app/src/main/java/com/example/mastermind/MasterMindActivity.java index 491773e..f02e619 100644 --- a/app/src/main/java/com/example/mastermind/MasterMindActivity.java +++ b/app/src/main/java/com/example/mastermind/MasterMindActivity.java @@ -2,6 +2,7 @@ package com.example.mastermind; import android.content.Intent; import android.os.Bundle; +import android.util.Log; import android.view.View; import android.widget.LinearLayout; @@ -54,37 +55,42 @@ public class MasterMindActivity extends AppCompatActivity { public void nextTurn(){ if(this.tour<9){ //on affiche la correction - this.afficherCorrection((LinearLayout) this.jeu.getChildAt(this.tour)); + boolean gagne = this.afficherCorrection((LinearLayout) this.jeu.getChildAt(this.tour)); //on supprime les listener if(this.tour>0){ LinearLayout anciennesPieces =(LinearLayout) this.jeu.getChildAt(this.tour-1); for(int i=0; i0){ LinearLayout anciennesPieces =(LinearLayout) this.jeu.getChildAt(this.tour-1); for(int i=0; i + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 44d41b7..e753ada 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -5,4 +5,6 @@ 15dp 5dp 30dp + 20dp + 15dp \ No newline at end of file