Ajout classe Cell

This commit is contained in:
Lyanis SOUIDI 2024-03-30 17:08:09 +01:00
parent 63c865e82a
commit 9bc43e93c9
2 changed files with 55 additions and 23 deletions

View File

@ -0,0 +1,55 @@
package fr.iutfbleau.sae;
import androidx.annotation.NonNull;
import java.io.Serializable;
public class Cell implements Serializable {
public int x;
public int y;
public Cell(int x, int y) {
this.x = x;
this.y = y;
}
public Cell(Cell cell) {
if (cell == null)
return;
this.x = cell.x;
this.y = cell.y;
}
@Override
public int hashCode() {
return this.x + this.y * 31;
}
@Override
public boolean equals(Object object) {
if (object == this)
return true;
if (object == null || this.getClass() != object.getClass())
return false;
Cell cell = (Cell) object;
return cell.x == this.x && cell.y == this.y;
}
@NonNull
@Override
public String toString() {
return "[" + this.x + "; " + this.y + "]";
}
}

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:key="preference_group"
android:title="@string/title">
<ListPreference
android:defaultValue="10"
android:entries="@array/size_list"
android:entryValues="@array/size_list_values"
android:key="size_preference"
android:title="@string/size" />
<CheckBoxPreference
android:defaultValue="false"
android:key="hard_mode_preference"
android:summary="@string/hard_mode_summary"
android:title="@string/hard_mode" />
</PreferenceCategory>
</PreferenceScreen>