예제 #1
0
  public Town get(HexPoint pointLocation) {
    for (Town town : pieces) {
      if (town.getPoint().equals(pointLocation)) {
        return town;
      }
    }

    throw new AssertionError("Expected town with specified HexPoint");
  }
예제 #2
0
  public boolean contains(HexPoint point) {
    for (Town town : pieces) if (town.getPoint().equals(point)) return true;

    return false;
  }