Examples of IsOccupoedAndUncompleted


Examples of com.jcloisterzone.feature.visitor.IsOccupoedAndUncompleted

    @Override
    public DeploymentCheckResult isDeploymentAllowed(Feature f) {
        if (!(f instanceof City || f instanceof Road) ) {
            return new DeploymentCheckResult("Builder must be placed in city or on road only.");
        }
        if (!f.walk(new IsOccupoedAndUncompleted().with(Follower.class))) {
            return new DeploymentCheckResult("Feature is not occupied by follower or completed.");
        }
        return super.isDeploymentAllowed(f);
    }
View Full Code Here

Examples of com.jcloisterzone.feature.visitor.IsOccupoedAndUncompleted

    private Set<Location> getPlayerFeatures(Player player, Class<? extends Feature> featureClass, boolean uncompletedOnly)  {
        Set<Location> locations = new HashSet<>();
        for (Feature f : features) {
            if (!featureClass.isInstance(f)) continue;
            IsOccupied visitor = uncompletedOnly ? new IsOccupoedAndUncompleted() : new IsOccupied();
            if (f.walk(visitor.with(player).with(Follower.class))) {
                locations.add(f.getLocation());
            }
        }
        return locations;
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.