Beispiel #1
0
  private Hut createHut(
      String name,
      String phone,
      String coordinates,
      String buildDate,
      String mapId,
      String picUrl,
      String capacity,
      String price) {
    ExpeditionMap map = manager.getExpeditionMap(Integer.parseInt(mapId));
    Hut hut = null;
    try {
      hut =
          new Hut(
              name,
              phone,
              coordinates,
              new Date(new SimpleDateFormat("yyyy-MM-dd").parse(buildDate).getTime()),
              map,
              picUrl,
              Integer.parseInt(capacity),
              Double.parseDouble(price));
    } catch (ParseException e) {
      e.printStackTrace();
    }

    manager.addHut(hut);

    return hut;
  }
Beispiel #2
0
  private Expedition createExpedition(
      String name, String description, String startVillage, String endVillage, String expMapId) {
    ExpeditionMap expMap = manager.getExpeditionMap(Integer.parseInt(expMapId));
    Expedition exp = new Expedition(name, description, startVillage, endVillage, expMap);

    manager.addExpedition(exp);

    return exp;
  }