Package com.jcloisterzone.feature

Source Code of com.jcloisterzone.feature.Cloister

package com.jcloisterzone.feature;


import static com.jcloisterzone.ui.I18nUtils._;

import com.jcloisterzone.PointCategory;
import com.jcloisterzone.board.Position;
import com.jcloisterzone.feature.visitor.score.CloisterScoreContext;
import com.jcloisterzone.feature.visitor.score.CompletableScoreContext;


public class Cloister extends TileFeature implements Completable {

    private boolean shrine;
    private boolean monastery;

    public boolean isShrine() {
        return shrine;
    }

    public void setShrine(boolean shrine) {
        this.shrine = shrine;
    }


    public boolean isMonastery() {
        return monastery;
    }

    public void setMonastery(boolean monastery) {
        this.monastery = monastery;
    }

    @Override
    public boolean isOpen() {
        Position p = getTile().getPosition();
        return getGame().getBoard().getAdjacentAndDiagonalTiles(p).size() < 8;
    }

    @Override
    public CompletableScoreContext getScoreContext() {
        return new CloisterScoreContext(getGame());
    }

    @Override
    public PointCategory getPointCategory() {
        return PointCategory.CLOISTER;
    }

    public static String name() {
        return _("Cloister");
    }

}
TOP

Related Classes of com.jcloisterzone.feature.Cloister

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.