/* CVS: $Id: Exploring.java,v 1.7 2001/03/18 19:16:33 gvijf Exp $ */

package evolution.actions;

import evolution.*;
import evolution.resources.*;
import evolution.lands.*;

/**
 * Exploring land.
 */
public class Exploring extends Action {

    /**
     * Extra things which should be done when this action's perform
     * method is called.
     * Template method.
     */
    protected void _perform(Human human) throws NotEnoughResourcesException, IllegalLandTypeException, NotEnoughLandResourcesException {
        SquareOfLand square = human.getSquareOfLand();
        double speed = Double.parseDouble(ActionKnowledgeCatalog.getInst().getProperty("Exploring.speed", "10"));
        square.setExplorationState(square.getExplorationState() + speed);
    }

    /**
     * Checks whether this action can be performed on the given square of land.
     */
    protected boolean canBePerformedOn(SquareOfLand square) {
        return !square.isExplored();
    }

}