Package com.jcloisterzone.feature.visitor

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


    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

Related Classes of com.jcloisterzone.feature.visitor.IsOccupoedAndUncompleted

Copyright © 2018 www.massapicom. 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.