37 lines
887 B
Java
37 lines
887 B
Java
package dev.kske.minesweeper;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Date;
|
|
|
|
/**
|
|
* Project: <strong>Minesweeper</strong><br>
|
|
* File: <strong>Score.java</strong><br>
|
|
* Created: <strong>16.04.2019</strong><br>
|
|
* Author: <strong>Kai S. K. Engelbart</strong>
|
|
*/
|
|
public class Score implements Comparable<Score>, Serializable {
|
|
|
|
private static final long serialVersionUID = 3384023296639779740L;
|
|
|
|
private final String name;
|
|
private final int duration;
|
|
private final Date date;
|
|
|
|
public Score(String name, int duration, Date date) {
|
|
this.name = name;
|
|
this.duration = duration;
|
|
this.date = date;
|
|
}
|
|
|
|
public String getName() { return name; }
|
|
|
|
public int getDuration() { return duration; }
|
|
|
|
public Date getDate() { return date; }
|
|
|
|
@Override
|
|
public int compareTo(Score other) {
|
|
return Integer.compare(duration, other.duration);
|
|
}
|
|
}
|