|
|
|
@ -1,30 +1,23 @@
|
|
|
|
|
package projet.iut.jeu_de_la_vie.view;
|
|
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.graphics.Color;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.text.Editable;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.widget.Button;
|
|
|
|
|
import android.widget.CheckBox;
|
|
|
|
|
import android.widget.EditText;
|
|
|
|
|
|
|
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
|
|
|
import androidx.constraintlayout.widget.ConstraintSet;
|
|
|
|
|
|
|
|
|
|
import java.awt.font.NumericShaper;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import projet.iut.jeu_de_la_vie.R;
|
|
|
|
|
import projet.iut.jeu_de_la_vie.model.FragmentPlateau;
|
|
|
|
|
import projet.iut.jeu_de_la_vie.model.Manager;
|
|
|
|
|
import projet.iut.jeu_de_la_vie.model.cellule.Cellule;
|
|
|
|
|
import projet.iut.jeu_de_la_vie.model.plateau.Plateau;
|
|
|
|
|
import projet.iut.jeu_de_la_vie.view.fragment.FragmentPlateau;
|
|
|
|
|
import projet.iut.jeu_de_la_vie.view.fragment.MenuFragment;
|
|
|
|
|
|
|
|
|
|
public class LauncherActivity extends AppCompatActivity {
|
|
|
|
|
|
|
|
|
@ -42,6 +35,7 @@ public class LauncherActivity extends AppCompatActivity {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
manager = new Manager();
|
|
|
|
|
setContentView(R.layout.jeu_de_la_vie);
|
|
|
|
|
FragmentPlateau fragmentPlateau = (FragmentPlateau) getSupportFragmentManager().findFragmentById(R.id.fragmentContainerViewId);
|
|
|
|
|
/*
|
|
|
|
|
//très moche à enlever plus tard
|
|
|
|
|
start = findViewById(R.id.startButton);
|
|
|
|
@ -70,10 +64,7 @@ public class LauncherActivity extends AppCompatActivity {
|
|
|
|
|
manager.getActualiseurCellule().getArbitre().getPlateau().getCell(0, 1).setAlive(true);
|
|
|
|
|
});
|
|
|
|
|
*/
|
|
|
|
|
getSupportFragmentManager().beginTransaction().add(R.id.fragmentContainerView,FragmentPlateau.class,null).commit();
|
|
|
|
|
FragmentPlateau frag = new FragmentPlateau();
|
|
|
|
|
getSupportFragmentManager().putFragment(new Bundle(),"main",frag);
|
|
|
|
|
manager.setFragmentPlateau(frag);
|
|
|
|
|
getSupportFragmentManager().beginTransaction().add(R.id.menuView,MenuFragment.class,null).commit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void updateGame (){
|
|
|
|
@ -83,8 +74,8 @@ public class LauncherActivity extends AppCompatActivity {
|
|
|
|
|
@Override
|
|
|
|
|
protected void onStart (){
|
|
|
|
|
super.onStart();
|
|
|
|
|
FragmentPlateau fragment = new FragmentPlateau();
|
|
|
|
|
fragment.setPlateau(manager.getActualiseurCellule().getArbitre().getPlateau());
|
|
|
|
|
//FragmentPlateau fragment = new FragmentPlateau();
|
|
|
|
|
//fragment.setPlateau(manager.getActualiseurCellule().getArbitre().getPlateau());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -113,9 +104,10 @@ public class LauncherActivity extends AppCompatActivity {
|
|
|
|
|
Log.d("d", "" + manager.getNumberOfLines());
|
|
|
|
|
Log.d("d", "" + manager.getNomberOfColumns());
|
|
|
|
|
Log.d("d", "" + Cellule.getLivingColor());
|
|
|
|
|
Intent intent = new Intent(this, GameActivity.class);
|
|
|
|
|
startActivity(intent);
|
|
|
|
|
//Intent intent = new Intent(this, GameActivity.class);
|
|
|
|
|
//startActivity(intent);
|
|
|
|
|
//setContentView(new PlateauView(this, manager.getNomberOfColumns() ,manager.getNumberOfLines()));
|
|
|
|
|
getSupportFragmentManager().beginTransaction().replace(R.id.fragmentContainerViewId, MenuFragment.class,null).commit();
|
|
|
|
|
}
|
|
|
|
|
public void setCellsRed(View view){
|
|
|
|
|
int red = Color.RED;
|
|
|
|
|