Search in sources :

Example 6 with MapZoneAndObject

use of com.example.alphatour.oggetti.MapZoneAndObject in project AlphaTour by Frank99DG.

the class Step4 method clear_Zones.

private void clear_Zones() {
    Iterator<MapZoneAndObject> it = zoneAndObjectList_.iterator();
    while (it.hasNext()) {
        MapZoneAndObject zone = it.next();
        String delete = "delete";
        if (delete.matches(zone.getZone())) {
            it.remove();
        }
    }
}
Also used : MapZoneAndObject(com.example.alphatour.oggetti.MapZoneAndObject)

Example 7 with MapZoneAndObject

use of com.example.alphatour.oggetti.MapZoneAndObject in project AlphaTour by Frank99DG.

the class Step5 method savePath.

private void savePath() {
    progressBar.setVisibility(View.VISIBLE);
    List<MapZoneAndObject> zoneAndObjectList = zoneAndObjectList_;
    MapZoneAndObject mapZoneAndOb = zoneAndObjectList.get(0);
    Path path = new Path();
    path.setName(mapZoneAndOb.getName());
    path.setDescription(mapZoneAndOb.getDescription());
    path.setIdUser(user.getUid());
    for (int i = 0; i < zoneAndObjectList_.size(); i++) {
        MapZoneAndObject mapZoneAndObject = zoneAndObjectList.get(i);
        // String delete = "delete";
        // if(!mapZoneAndObject.getZone().matches(delete)) {
        ZoneChoosed zoneChoosed = new ZoneChoosed();
        zoneChoosed.setName(mapZoneAndObject.getZone());
        List<String> obj = mapZoneAndObject.getListObj();
        for (int j = 0; j < obj.size(); j++) {
            zoneChoosed.setObjectChoosed(obj.get(j));
        }
        graph.addVertex(zoneChoosed);
        zoneChooseds.add(zoneChoosed);
        if (i >= 1) {
            graph.addEdge(zoneChooseds.get(i - 1), zoneChooseds.get(i));
        }
        path.setZonePath(zoneChoosed);
    // }
    }
}
Also used : Path(com.example.alphatour.oggetti.Path) ZoneChoosed(com.example.alphatour.oggetti.ZoneChoosed) MapZoneAndObject(com.example.alphatour.oggetti.MapZoneAndObject)

Aggregations

MapZoneAndObject (com.example.alphatour.oggetti.MapZoneAndObject)7 Intent (android.content.Intent)3 Path (com.example.alphatour.oggetti.Path)2 ZoneChoosed (com.example.alphatour.oggetti.ZoneChoosed)2 Nullable (androidx.annotation.Nullable)1 VerificationError (com.stepstone.stepper.VerificationError)1