Réorganisation du dossier
This commit is contained in:
@@ -27,7 +27,7 @@ public class EtatJeu {
|
|||||||
this.plateau = new Plateau(this.aleatoire);
|
this.plateau = new Plateau(this.aleatoire);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Getters ---
|
// --- Getters
|
||||||
|
|
||||||
public int obtenirScore() {
|
public int obtenirScore() {
|
||||||
return score;
|
return score;
|
||||||
@@ -59,7 +59,7 @@ public class EtatJeu {
|
|||||||
return copie;
|
return copie;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Actions ---
|
// --- Actions
|
||||||
|
|
||||||
public boolean appliquerCoup(boolean estLigne, int index, int sens) {
|
public boolean appliquerCoup(boolean estLigne, int index, int sens) {
|
||||||
if (partieTerminee || plateau.estBloque(estLigne, index)) {
|
if (partieTerminee || plateau.estBloque(estLigne, index)) {
|
||||||
@@ -259,9 +259,8 @@ public class EtatJeu {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void restaurerEtat(Bundle b) {
|
public void restaurerEtat(Bundle b) {
|
||||||
if (!b.containsKey("grille")) {
|
if (!b.containsKey("grille")) return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
int[] g = b.getIntArray("grille");
|
int[] g = b.getIntArray("grille");
|
||||||
boolean[] v = b.getBooleanArray("verrous");
|
boolean[] v = b.getBooleanArray("verrous");
|
||||||
int[][] grid = plateau.getGrille();
|
int[][] grid = plateau.getGrille();
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ public class MainActivity extends Activity {
|
|||||||
private Controleur controleur;
|
private Controleur controleur;
|
||||||
private boolean hardMode;
|
private boolean hardMode;
|
||||||
private EtatJeu etatJeu;
|
private EtatJeu etatJeu;
|
||||||
|
|
||||||
private Button btnMenu;
|
private Button btnMenu;
|
||||||
private VueGrille vueGrille;
|
private VueGrille vueGrille;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class VueGrille extends View {
|
|||||||
|
|
||||||
// Données nécessaires au dessin
|
// Données nécessaires au dessin
|
||||||
|
|
||||||
private int[][] grille = new int[NB_LIGNES][NB_COLONNES];
|
private int[][] grille = new int[NB_LIGNES][NB_COLONNES];
|
||||||
private boolean[][] verrous = new boolean[NB_LIGNES][NB_COLONNES];
|
private boolean[][] verrous = new boolean[NB_LIGNES][NB_COLONNES];
|
||||||
|
|
||||||
private Boolean animEstLigne = null;
|
private Boolean animEstLigne = null;
|
||||||
@@ -205,8 +205,7 @@ public class VueGrille extends View {
|
|||||||
canvas.drawRoundRect(x1, y1, x2, y2, 20, 20, pinceauCase);
|
canvas.drawRoundRect(x1, y1, x2, y2, 20, 20, pinceauCase);
|
||||||
|
|
||||||
if (animEstLigne != null) {
|
if (animEstLigne != null) {
|
||||||
if ((animEstLigne && ligne == animIndex)
|
if ((animEstLigne && ligne == animIndex) || (!animEstLigne && colonne == animIndex)) {
|
||||||
|| (!animEstLigne && colonne == animIndex)) {
|
|
||||||
canvas.drawRoundRect(x1, y1, x2, y2, 20, 20, pinceauSelection);
|
canvas.drawRoundRect(x1, y1, x2, y2, 20, 20, pinceauSelection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="36dp"
|
||||||
|
android:background="#1A1A2E">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvScore"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Score : 0"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#FFFFFF"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCoups"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Coups : 0"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textColor="#AAAACC"/>
|
||||||
|
|
||||||
|
<!-- Section pour le Hard Mode -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvObjectif"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Objectif : ..."
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#E94560"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvNbObjectifs"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Objectifs réussis : 0"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:textColor="#E2C94E"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<!-- Ligne Clés (Hard Mode) -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutCles"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingTop="6dp"
|
||||||
|
android:paddingBottom="6dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCles"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="🗝️ Clés : 0 (Max 1)"
|
||||||
|
android:textColor="#E2C94E"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnReinitialisationObjectif"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Réinitialiser objectif"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:backgroundTint="#E94560"
|
||||||
|
android:textColor="#FFFFFF"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<sae.chuzzle.VueGrille
|
||||||
|
android:id="@+id/vueGrille"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnMenu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Menu"
|
||||||
|
android:backgroundTint="#E94560"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:layout_margin="50dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="32dp"
|
||||||
|
android:background="#1A1A2E">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Options"
|
||||||
|
android:textSize="32sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#E94560"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginBottom="32dp"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:text="Hard mode"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textColor="#FFFFFF"/>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/checkHard"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scaleX="1.5"
|
||||||
|
android:scaleY="1.5"
|
||||||
|
android:buttonTint="#E94560"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:minWidth="48dp"
|
||||||
|
android:minHeight="48dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="En mode difficile, vous devez remplir des objectifs avant la fin d'un nombre indiqué de coups. \n\ \n\2 Objectifs réussis vous rapporte une Clé 🗝️. \n\4 Coups réussis vous rapporte une Clé 🗝️.\n\ \n\Cette clé vous permet de changer votre objectif si vous êtes bloqué. Attention, vous ne pouvez en porter qu'une seule à la fois !"
|
||||||
|
android:textColor="#AAAACC"
|
||||||
|
android:textSize="14sp"
|
||||||
|
android:background="#16213E"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:lineSpacingExtra="4dp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnBack"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:text="Retour"
|
||||||
|
android:backgroundTint="#E94560"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:layout_marginTop="32dp">
|
||||||
|
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
Reference in New Issue
Block a user