diff --git a/app/src/main/java/com/example/mastermind/MasterMindActivity.java b/app/src/main/java/com/example/mastermind/MasterMindActivity.java index 8e3d591..491773e 100644 --- a/app/src/main/java/com/example/mastermind/MasterMindActivity.java +++ b/app/src/main/java/com/example/mastermind/MasterMindActivity.java @@ -8,25 +8,39 @@ import android.widget.LinearLayout; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; +import com.example.mastermind.controller.mastermind.MonNextTurnTouch; import com.example.mastermind.controller.mastermind.MonOnTouchListener; import com.example.mastermind.vue.mastermind.UnePiece; public class MasterMindActivity extends AppCompatActivity { private int[] code; + + private int tour; + + private LinearLayout jeu; + + private LinearLayout correction; + + private boolean vide; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_master_mind); Intent data=this.getIntent(); this.code=data.getIntArrayExtra("code"); - LinearLayout l=this.findViewById(R.id.jeu); + this.vide=data.getBooleanExtra("vide", false); + this.jeu=this.findViewById(R.id.jeu); + this.correction=this.findViewById(R.id.correction); + this.tour=0; + this.findViewById(R.id.tour).setOnTouchListener(new MonNextTurnTouch(this)); - for(int i=0; i0){ + 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 + +