Examples of FairyCapability


Examples of com.jcloisterzone.game.capability.FairyCapability

        return rank;
    }

    protected double rankFairy(Game game) {
        if (!game.hasCapability(FairyCapability.class)) return 0;
        FairyCapability fc = game.getCapability(FairyCapability.class);
        Position fairyPos = fc.getFairyPosition();
        if (fairyPos == null) return 0;

        double rating = 0;

//    TODO more sophisticated rating
View Full Code Here

Examples of com.jcloisterzone.game.capability.FairyCapability

    @Override
    public void undo(Game game) {
        switch (getType()) {
        case FAIRY:
            FairyCapability fCap = game.getCapability(FairyCapability.class);
            fCap.setFairyPosition(getFrom());
            break;
        case DRAGON:
            DragonCapability dCap = game.getCapability(DragonCapability.class);
            dCap.setDragonPosition(getFrom());
            break;
View Full Code Here

Examples of com.jcloisterzone.game.capability.FairyCapability

    public void moveFairy(Position p) {
        if (!Iterables.any(getActivePlayer().getFollowers(), MeeplePredicates.at(p))) {
            throw new IllegalArgumentException("The tile has deployed not own follower.");
        }

        FairyCapability cap = game.getCapability(FairyCapability.class);
        Position fromPosition = cap.getFairyPosition();
        cap.setFairyPosition(p);
        game.post(new NeutralFigureMoveEvent(NeutralFigureMoveEvent.FAIRY, getActivePlayer(), fromPosition, p));
        next();
    }
View Full Code Here

Examples of com.jcloisterzone.game.capability.FairyCapability

        super(game);
    }

    @Override
    public void enter() {
        FairyCapability fairyCap = game.getCapability(FairyCapability.class);
        if (fairyCap != null) {
            //erase position to not affect final scoring
            fairyCap.setFairyPosition(null);
        }

        ScoreAllFeatureFinder scoreAll = new ScoreAllFeatureFinder();
        scoreAll.scoreAll(game, this);
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.