diff --git a/turingmachine/src/main/java/com/turingmachine/core/Save.java b/turingmachine/src/main/java/com/turingmachine/core/Save.java deleted file mode 100644 index c2abd10..0000000 --- a/turingmachine/src/main/java/com/turingmachine/core/Save.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.turingmachine.core; - -public class Save { - private int problemId; - private int testCount; - private String username; - - public Save(int _problemId, int _testCount, String _username) { - this.problemId = _problemId; - this.testCount = _testCount; - this.username = _username; - } - - public int getProblemId() { - return this.problemId; - } - - public int getTestCount() { - return this.testCount; - } - - public String getUsername() { - return this.username; - } - - public void updateTestCount(int _testCount) { - if (0 <= _testCount && _testCount < this.testCount) - this.testCount = _testCount; - } -} \ No newline at end of file diff --git a/turingmachine/src/main/java/com/turingmachine/gui/MainMenuController.java b/turingmachine/src/main/java/com/turingmachine/gui/MainMenuController.java index aa51449..bd3ab18 100644 --- a/turingmachine/src/main/java/com/turingmachine/gui/MainMenuController.java +++ b/turingmachine/src/main/java/com/turingmachine/gui/MainMenuController.java @@ -10,12 +10,6 @@ private void startGame() throws IOException { TuringMachine.setRoot("player-menu"); } - @FXML - private void showHighScores() { - - } - - @FXML public void quit() { System.exit(0); diff --git a/turingmachine/src/main/java/com/turingmachine/parser/SaveParser.java b/turingmachine/src/main/java/com/turingmachine/parser/SaveParser.java deleted file mode 100644 index df7cc6c..0000000 --- a/turingmachine/src/main/java/com/turingmachine/parser/SaveParser.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.turingmachine.parser; - -import java.io.FileWriter; -import java.io.IOException; -import java.util.ArrayList; - -import com.turingmachine.core.Save; -import com.turingmachine.util.FileLiterator; - - -public class SaveParser extends Parser { - public SaveParser(String filename) { - super(filename); - } - - public Save parseSave(String rawString) { - //problemId;testCount;username - // 1; 3;"username" - //1;3;username - //extracted string looks like this ^ - String[] tokens = super.tokenize(rawString, ";"); - int problemId = Integer.parseInt(tokens[0]); - int testCount = Integer.parseInt(tokens[1]); - String username = tokens[2]; - - return new Save(problemId, testCount, username); - } - - public ArrayList getSaves(String filename) { - ArrayList saves = new ArrayList(); - - while (fileLiterator.hasNextLine(scanner)) { - String rawString = fileLiterator.readLine(scanner); - Save save = parseSave(rawString); - saves.add(save); - } - return saves; - } - - public void writeSaves(ArrayList saves, String sep) { - FileWriter fileWriter = super.fileLiterator.writeFile(); - for (Save save : saves) { - String rawString = save.getProblemId() + sep + save.getTestCount() + sep + save.getUsername(); - try { - super.fileLiterator.writeLine(fileWriter, rawString); - } catch (IOException e) { - System.out.println("An error occurred."); - e.printStackTrace(); - return; - } - } - } -} \ No newline at end of file diff --git a/turingmachine/src/main/resources/com/turingmachine/gui/main-menu.fxml b/turingmachine/src/main/resources/com/turingmachine/gui/main-menu.fxml index f9947bb..d164715 100644 --- a/turingmachine/src/main/resources/com/turingmachine/gui/main-menu.fxml +++ b/turingmachine/src/main/resources/com/turingmachine/gui/main-menu.fxml @@ -17,8 +17,7 @@ -