2023-03-19 22:36:49 +01:00
|
|
|
package com.example.mastermind;
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.os.Bundle;
|
2023-04-07 14:29:23 +02:00
|
|
|
import android.view.View;
|
|
|
|
import android.widget.LinearLayout;
|
2023-03-19 22:36:49 +01:00
|
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
2023-04-07 14:29:23 +02:00
|
|
|
import com.example.mastermind.controller.mastermind.MonOnTouchListener;
|
|
|
|
import com.example.mastermind.vue.mastermind.UnePiece;
|
|
|
|
|
2023-03-19 22:36:49 +01:00
|
|
|
public class MasterMindActivity extends AppCompatActivity {
|
|
|
|
|
2023-04-07 14:29:23 +02:00
|
|
|
private int[] code;
|
2023-03-19 22:36:49 +01:00
|
|
|
@Override
|
|
|
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
setContentView(R.layout.activity_master_mind);
|
|
|
|
Intent data=this.getIntent();
|
2023-04-07 14:29:23 +02:00
|
|
|
this.code=data.getIntArrayExtra("code");
|
|
|
|
LinearLayout l=this.findViewById(R.id.jeu);
|
|
|
|
|
|
|
|
for(int i=0; i<l.getChildCount(); i++){
|
|
|
|
LinearLayout fils = (LinearLayout) l.getChildAt(i);
|
|
|
|
for(int j=0; j<fils.getChildCount(); j++){
|
|
|
|
fils.getChildAt(j).setOnTouchListener(new MonOnTouchListener((UnePiece) fils.getChildAt(j), data.getBooleanExtra("vide", false)));
|
|
|
|
}
|
2023-04-06 22:51:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onBackPressed() {
|
|
|
|
Intent menu=new Intent(this, MenuActivity.class);
|
|
|
|
this.startActivity(menu);
|
|
|
|
this.finish();
|
2023-03-19 22:36:49 +01:00
|
|
|
}
|
|
|
|
}
|