diff --git a/Assignment 2/src/ca/cosc3p91/a2/game/GameEngine.java b/Assignment 2/src/ca/cosc3p91/a2/game/GameEngine.java index 37cfbe6..7e5d637 100644 --- a/Assignment 2/src/ca/cosc3p91/a2/game/GameEngine.java +++ b/Assignment 2/src/ca/cosc3p91/a2/game/GameEngine.java @@ -65,7 +65,7 @@ public class GameEngine implements Runnable { for (Building b : map.contains) buildingPrinter.addRow(new Print.Row(b.getClass().getSimpleName(), - Integer.toString(b.getLevel()), + Integer.toString(b.getLevel() + 1), Integer.toString(b.getHealth()))); Print.print(buildingPrinter.createTable(true, false, true)); @@ -204,7 +204,8 @@ public class GameEngine implements Runnable { System.err.println("Args are not a valid building!"); else if (this.map.build(new Tile(), type) ) { System.out.println(type.getClass().getSimpleName()+" successfully built\n"); - } else System.out.println("Missing resources to build "+type.getClass().getSimpleName()); + } else + System.out.println("Missing resources to build "+type.getClass().getSimpleName()); } break; case '2': @@ -219,6 +220,10 @@ public class GameEngine implements Runnable { } else System.out.println("Missing gold to train "+type.getClass().getSimpleName()); } break; + case '3': + break; + case '4': + break; case '5': printState(this.map,"Home Village"); break; @@ -230,7 +235,7 @@ public class GameEngine implements Runnable { } printMenuOptions(); } - } catch (IOException e) { + } catch (Exception e) { throw new RuntimeException(e); } } diff --git a/Assignment 2/src/ca/cosc3p91/a2/game/Map.java b/Assignment 2/src/ca/cosc3p91/a2/game/Map.java index c76ee5a..63b2347 100644 --- a/Assignment 2/src/ca/cosc3p91/a2/game/Map.java +++ b/Assignment 2/src/ca/cosc3p91/a2/game/Map.java @@ -49,7 +49,8 @@ public class Map { throw new RuntimeException("Unable to subtract wood despite valid check!"); contains.add(b); return true; - } else return false; + } else + return false; } public boolean train(Inhabitant i) {