package com.example.mastermind; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; 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"); 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)); //on récupere le LinearLayout des pieces du tour LinearLayout pieces =(LinearLayout) this.jeu.getChildAt(this.tour); //on ajoute le listener 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