Ajout classe Cell
This commit is contained in:
parent
63c865e82a
commit
9bc43e93c9
55
app/src/main/java/fr/iutfbleau/sae/Cell.java
Normal file
55
app/src/main/java/fr/iutfbleau/sae/Cell.java
Normal 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 + "]";
|
||||
}
|
||||
}
|
@ -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>
|
Loading…
Reference in New Issue
Block a user