Пример #1
0
  private void checkAreasConnectivity(ResourceEntry entry, Resource area) {
    ResourceRef darearef, rref;
    ITEPoint ttriger;

    checkNearestArea(entry, "Area north");
    checkNearestArea(entry, "Area east");
    checkNearestArea(entry, "Area south");
    checkNearestArea(entry, "Area west");

    List<StructEntry> list = ((AreResource) area).getList();
    for (int i = 0; i < list.size(); i++)
      if (list.get(i) instanceof ITEPoint) {
        ttriger = (ITEPoint) list.get(i);
        if (((Bitmap) ttriger.getAttribute("Type")).getValue() == 2) {
          darearef = (ResourceRef) ttriger.getAttribute("Destination area");
          if (!ResourceFactory.getInstance().resourceExists(darearef.getResourceName())) {
            rref = (ResourceRef) ttriger.getAttribute("Script");
            if (!ResourceFactory.getInstance().resourceExists(rref.getResourceName()))
              errorTable.addTableItem(
                  new AreaTableLine(
                      entry, ttriger, "No target area " + darearef.getResourceName()));
          } else checkAreaEntrance(entry, ttriger, darearef);
        }
      }
  }
Пример #2
0
  private void checkAreaEntrance(ResourceEntry entry, ITEPoint tTriger, ResourceRef dAreaRef) {
    boolean isFound = false;
    TextString entName;
    AreResource dArea;

    entName = (TextString) tTriger.getAttribute("Entrance name");
    dArea =
        (AreResource)
            ResourceFactory.getResource(
                ResourceFactory.getInstance().getResourceEntry(dAreaRef.getResourceName()));

    List<StructEntry> list = dArea.getList();
    for (int i = 0; i < list.size(); i++)
      if (list.get(i) instanceof Entrance
          && entName
              .toString()
              .equalsIgnoreCase(((Entrance) list.get(i)).getAttribute("Name").toString()))
        isFound = true;

    if (!isFound)
      errorTable.addTableItem(
          new AreaTableLine(
              entry,
              tTriger,
              "No target entrance "
                  + entName.toString()
                  + " in area "
                  + dAreaRef.getResourceName()));
  }