parent
4673b07609
commit
17fc525236
@ -0,0 +1,33 @@
|
|||||||
|
package projet.iut.jeu_de_la_vie.adaptateur;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
public class RegleAdaptateur extends RecyclerView.Adapter<RegleAdaptateur.ViewHolder> {
|
||||||
|
|
||||||
|
public static class ViewHolder extends RecyclerView.ViewHolder{
|
||||||
|
|
||||||
|
public ViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
@ -1,14 +1,62 @@
|
|||||||
package projet.iut.jeu_de_la_vie.launcher;
|
package projet.iut.jeu_de_la_vie.launcher;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import projet.iut.jeu_de_la_vie.R;
|
import projet.iut.jeu_de_la_vie.R;
|
||||||
|
import projet.iut.jeu_de_la_vie.model.Manager;
|
||||||
|
import projet.iut.jeu_de_la_vie.model.cellule.Cellule;
|
||||||
|
|
||||||
public class Launcher extends AppCompatActivity {
|
public class Launcher extends AppCompatActivity {
|
||||||
|
|
||||||
|
private Manager manager;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
manager = new Manager();
|
||||||
setContentView(R.layout.menu_principal);
|
setContentView(R.layout.menu_principal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void setNbColumns(){
|
||||||
|
EditText editText = findViewById(R.id.nbColone);
|
||||||
|
Editable text = editText.getText();
|
||||||
|
manager.setNumberOfColumns(Integer.parseInt(text.toString()));
|
||||||
|
}
|
||||||
|
private void setNbLignes(){
|
||||||
|
EditText editText = findViewById(R.id.nbLignes);
|
||||||
|
Editable text = editText.getText();
|
||||||
|
manager.setNumberOfLines(Integer.parseInt(text.toString()));
|
||||||
|
}
|
||||||
|
private void setCellsColor(int color){
|
||||||
|
manager.setCellsColor(color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startGame(View view){
|
||||||
|
setNbLignes();
|
||||||
|
setNbColumns();
|
||||||
|
Log.d("d", "" + manager.getActualiseurCellule().getArbitre().getPlateau().getColone());
|
||||||
|
Log.d("d", "" + manager.getActualiseurCellule().getArbitre().getPlateau().getLigne());
|
||||||
|
Log.d("d", "" + Cellule.getLivingColor());
|
||||||
|
}
|
||||||
|
public void setCellsRed(View view){
|
||||||
|
int red = Color.RED;
|
||||||
|
setCellsColor(red);
|
||||||
|
}
|
||||||
|
public void setCellsGreen(View view){
|
||||||
|
int green = Color.GREEN;
|
||||||
|
setCellsColor(green);
|
||||||
|
}
|
||||||
|
public void setCellsBlue(View view){
|
||||||
|
int blue = Color.BLUE;
|
||||||
|
setCellsColor(blue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/elemnt"/>
|
||||||
|
</FrameLayout>
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="409dp"
|
||||||
|
android:layout_height="729dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/button"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Button"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/button2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Button"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/button" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in new issue