Examples of squareDistance()


Examples of com.jcloisterzone.board.Position.squareDistance()

    public void selectDragonMove(Game game) {
        Position dragonPosition = game.getCapability(DragonCapability.class).getDragonPosition();
        double tensionX = 0, tensionY = 0;

        for (Meeple m : game.getDeployedMeeples()) {
            int distance = dragonPosition.squareDistance(m.getPosition());
            if (distance == 0 || distance > rootEv.getMovesLeft()) continue;
            if (m.getFeature() instanceof Castle) continue;

            double weight = 1.0 / (distance * distance);
            if (aiPlayer.getPlayer().equals(m.getPlayer())) {
View Full Code Here

Examples of com.jcloisterzone.board.Position.squareDistance()

        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
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.