diff --git a/Documents/REFACTORING LIST.docx b/Documents/REFACTORING LIST.docx index 3fc660f..e6df6e5 100644 Binary files a/Documents/REFACTORING LIST.docx and b/Documents/REFACTORING LIST.docx differ diff --git a/Documents/~$FACTORING LIST.docx b/Documents/~$FACTORING LIST.docx deleted file mode 100644 index 7db2af4..0000000 Binary files a/Documents/~$FACTORING LIST.docx and /dev/null differ diff --git a/src/com/concordia/riskgame/controller/CommandController.java b/src/com/concordia/riskgame/controller/CommandController.java index 582c80d..a187d23 100644 --- a/src/com/concordia/riskgame/controller/CommandController.java +++ b/src/com/concordia/riskgame/controller/CommandController.java @@ -573,8 +573,7 @@ public static void saveMap(String command) } public static void loadGame(String command){ - String fileName = command.split(" ")[1]; - // System.out.println("hello"+" "+fileName); + String fileName = Constants.saveLocation+command.split(" ")[1]; FileInputStream fs = null; try { fs = new FileInputStream(fileName); @@ -1016,7 +1015,7 @@ public static void saveGame() String saveFilename=ScannerUtil.sc.nextLine(); - FileOutputStream fs = new FileOutputStream("./Saved_Games/" + saveFilename + ".bin"); + FileOutputStream fs = new FileOutputStream(Constants.saveLocation + saveFilename + ".bin"); ObjectOutputStream os = new ObjectOutputStream(fs); try { os.writeObject(Gameplay.getInstance()); diff --git a/src/com/concordia/riskgame/utilities/Constants.java b/src/com/concordia/riskgame/utilities/Constants.java index 19305ff..e0a2383 100644 --- a/src/com/concordia/riskgame/utilities/Constants.java +++ b/src/com/concordia/riskgame/utilities/Constants.java @@ -29,4 +29,5 @@ public class Constants { public static final Border blackline = BorderFactory.createLineBorder(Color.black); public static final String mapLocation=System.getProperty("user.dir")+"\\Maps\\Valid_Maps\\"; public static final String mapType="Domination"; + public static final String saveLocation="./Saved_Games/"; }