Package com.jcloisterzone.action

Examples of com.jcloisterzone.action.TakePrisonerAction


    }

    @Override
    public void enter() {
        Position pos = towerCap.getLastIncreasedTower();
        TakePrisonerAction captureAction = prepareCapture(pos, getBoard().get(pos).getTower().getHeight());
        if (captureAction.isEmpty()) {
            next();
            return;
        }
        game.post(new SelectActionEvent(getActivePlayer(), captureAction, true));
    }
View Full Code Here


        game.post(new SelectActionEvent(getActivePlayer(), captureAction, true));
    }

    private TakePrisonerAction prepareCapture(Position p, int range) {
        //TODO custom rule - opponent only
        TakePrisonerAction captureAction = new TakePrisonerAction();
        for (Meeple pf : game.getDeployedMeeples()) {
            if (!(pf instanceof Follower)) continue;
            Position pos = pf.getPosition();
            if (pos.x != p.x && pos.y != p.y) continue; //check if is in same row or column
            if (pos.squareDistance(p) > range) continue;
            captureAction.add(new MeeplePointer(pf));
        }
        return captureAction;
    }
View Full Code Here

TOP

Related Classes of com.jcloisterzone.action.TakePrisonerAction

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.