Examples of Vegetation


Examples of org.freerealm.vegetation.Vegetation

        setRealm(realm);
    }

    @Override
    public void execute(Realm realm) {
        Vegetation vegetation = realm.getTile(getUnit().getCoordinate()).getVegetation();
        if (vegetation != null) {
            int turnsSpent = realm.getNumberOfTurns() - getTurnGiven();
            if (turnsSpent >= vegetation.getTurnsNeededToClear()) {
                SetTileVegetationCommand setTileVegetationCommand = new SetTileVegetationCommand(getUnit().getCoordinate(), null);
                Executor.getInstance().execute(setTileVegetationCommand);
                setComplete(true);
            } else {
                getUnit().setMovementPoints(0);
View Full Code Here

Examples of org.freerealm.vegetation.Vegetation

        return NAME;
    }

    @Override
    public int getRemainingTurns() {
        Vegetation vegetation = getRealm().getTile(getUnit().getCoordinate()).getVegetation();
        if (vegetation != null) {
            int turnsSpent = getRealm().getNumberOfTurns() - getTurnGiven();
            return vegetation.getTurnsNeededToClear() - turnsSpent;
        }
        return -1;
    }
View Full Code Here

Examples of org.freerealm.vegetation.Vegetation

    public VegetationManager initializeFromNode(Realm realm, Node node) {
        VegetationManagerImpl vegetationManager = new VegetationManagerImpl();
        for (Node vegetationNode = node.getFirstChild(); vegetationNode != null; vegetationNode = vegetationNode.getNextSibling()) {
            if (vegetationNode.getNodeType() == Node.ELEMENT_NODE) {
                Vegetation vegetation = (new VegetationImplXMLConverter()).initializeFromNode(realm, vegetationNode);
                vegetationManager.addVegetation(vegetation);
            }
        }
        return vegetationManager;
    }
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.