Examples of IsOccupiedOrCompleted


Examples of com.jcloisterzone.feature.visitor.IsOccupiedOrCompleted

        if (source.getTile().isAbbeyTile()) {
            List<FeaturePointer> wagonMoves = new ArrayList<>();
            for (Entry<Location, Tile> entry : getBoard().getAdjacentTilesMap(source.getTile().getPosition()).entrySet()) {
                Tile tile = entry.getValue();
                Feature f = tile.getFeaturePartOf(entry.getKey().rev());
                if (f == null || f.walk(new IsOccupiedOrCompleted())) continue;
                wagonMoves.add(new FeaturePointer(tile.getPosition(), f.getLocation()));
            }
            return wagonMoves;
        } else {
            return source.walk(new FindUnoccupiedNeighbours());
View Full Code Here

Examples of com.jcloisterzone.feature.visitor.IsOccupiedOrCompleted

                                if (j == i) {
                                    //Abbey at side;
                                    Position target = f.getTile().getPosition().add(side);
                                    Tile abbeyTile = getBoard().get(target);
                                    assert abbeyTile.isAbbeyTile();
                                    if (!abbeyTile.getCloister().walk(new IsOccupiedOrCompleted())) {
                                        wagonMoves.add(new FeaturePointer(target, Location.CLOISTER));
                                    }
                                }
                                j++;
                            }
                        }
                        break;
                    }
                }
            }

            if (feature.getNeighbouring() != null) {
                for (Feature nei : feature.getNeighbouring()) {
                    if (nei.walk(new IsOccupiedOrCompleted())) continue;
                    wagonMoves.add(new FeaturePointer(nei.getTile().getPosition(), nei.getLocation()));
                }
            }
            return true;
        }
View Full Code Here

Examples of com.jcloisterzone.feature.visitor.IsOccupiedOrCompleted

        for (Feature f : features) {
            //if (f instanceof Farm && !game.hasCapability(Capability.FARM_PLACEMENT)) continue;
            if (f instanceof Scoreable) {
                IsOccupied visitor;
                if (excludeCompleted && f instanceof Completable) {
                    visitor = new IsOccupiedOrCompleted();
                } else {
                    visitor = new IsOccupied();
                }
                if (f.walk(visitor)) continue;
                locations.add(f.getLocation());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.