You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
836 B
41 lines
836 B
package model;
|
|
|
|
import java.io.*;
|
|
import java.util.ArrayList;
|
|
|
|
public class Database implements Serializable {
|
|
|
|
private int maxScore;
|
|
private static Database db;
|
|
|
|
private final ArrayList<DataTable> databaseFiles;
|
|
|
|
public Database() {
|
|
this.maxScore = 1;
|
|
databaseFiles = new ArrayList<DataTable>();
|
|
}
|
|
|
|
public int getMaxScore() {
|
|
return maxScore;
|
|
}
|
|
|
|
public void setMaxScore(int maxLevel) {
|
|
if (this.maxScore < maxLevel) this.maxScore = maxLevel;
|
|
}
|
|
|
|
public void addData(DataTable d) {
|
|
databaseFiles.add(d);
|
|
}
|
|
|
|
public void removeData(DataTable d) {
|
|
databaseFiles.remove(d);
|
|
}
|
|
|
|
public static void resetScore() {
|
|
db = new Database();
|
|
}
|
|
|
|
public ArrayList<DataTable> getDatabaseFiles() {
|
|
return databaseFiles;
|
|
}
|
|
} |