Skip to content

Commit

Permalink
World.addLocation() should throw an exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernardo Sulzbach committed Oct 12, 2015
1 parent ca1a0e2 commit f483cdf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/org/dungeon/game/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ public Date getWorldDate() {
}

public void addLocation(Location locationObject, Point coordinates) {
if (locations.containsKey(coordinates)) {
throw new IllegalStateException("tried to repeatedly add a location to " + coordinates + ".");
}
locations.put(coordinates, locationObject);
worldStatistics.addLocation(locationObject.getName().getSingular());
}
Expand Down

0 comments on commit f483cdf

Please sign in to comment.