diff --git a/Assignment 3/src/ca/cosc3p91/a2/game/GameEngine.java b/Assignment 3/src/ca/cosc3p91/a2/game/GameEngine.java index 8758d4c..3dfd320 100644 --- a/Assignment 3/src/ca/cosc3p91/a2/game/GameEngine.java +++ b/Assignment 3/src/ca/cosc3p91/a2/game/GameEngine.java @@ -146,7 +146,6 @@ public class GameEngine implements Runnable { view.printVillageState(this.map,"Current Village State"); view.printGameMenu(); - System.out.println(); Map exploringMap = null; boolean deleteMyHeart = true; while (running) { @@ -158,8 +157,8 @@ public class GameEngine implements Runnable { try { if ((in = view.nextInput()) != null) { String[] args = in.split(" "); - System.out.println("Your Input: "); - System.out.println("\t->" + in + '\n'); + + view.printLastInput(); // reset the map if they aren't exploring if (in.charAt(0) != '4') deleteMyHeart = true; diff --git a/Assignment 3/src/ca/cosc3p91/a2/userinterface/GameDisplay.java b/Assignment 3/src/ca/cosc3p91/a2/userinterface/GameDisplay.java index cb58f3d..691a05f 100644 --- a/Assignment 3/src/ca/cosc3p91/a2/userinterface/GameDisplay.java +++ b/Assignment 3/src/ca/cosc3p91/a2/userinterface/GameDisplay.java @@ -22,10 +22,15 @@ public class GameDisplay { public String nextInput() throws IOException { if (reader.ready()) { - return scanner.nextLine(); + return (input = scanner.nextLine()); } else return null; } + public void printLastInput() { + System.out.println("\nYour Input: "); + System.out.println("\t->" + input + '\n'); + } + public void printVillageState(Map map, String displayName) { Print resourcesPrinter = new Print(displayName, 2);