Location: PHPKode > projects > PhpBlock > A9.8/modules/dungeon/action/buildexploitedgold.class.php
<?php
include_once $PATH_TO_CODE."/modules/dungeon/action/abstractchangezonetype.class.php";

class BuildExploitedGold extends DungeonAbstractChangeZoneTypeAction {
    function __construct() {
        parent::__construct(DungeonConstante::$ACTION_EXPLOIT_GOLD, DungeonConstante::$ZONE_TYPE_GOLD_EXPLOITED, 0);
    }

    public function isOkToChange($locBlock, $locZone) {
        $locManageAction = ManageAction::getInstance();
        $locPlayer = $locManageAction->getPlayer();
        if($locZone->zoneType != DungeonConstante::$ZONE_TYPE_GOLD) {
            $locManageAction->addPlayerInfo("Target zone is not an gold mine");
            return false;
        }

        return parent::isOkToChange($locBlock, $locZone);
    }
        /*

        if(!((($locZone->zoneType == Constante::$ZONE_TYPE_PLAIN)
                && !$locZone->isOccuped())
                || $locZone->isHole()
                || ($locZone->zoneType == DungeonConstante::$ZONE_TYPE_STONE)
                || ($locZone->zoneType == DungeonConstante::$ZONE_TYPE_ROCK))) {
            $locManageAction->addPlayerInfo("Target zone is not free (or not rock)");
            return false;
        }
        return parent::isOkToChange($locZone, $locBlock);

        /*
        if($this->getZoneAndBlock($parZoneActionArray, $locZone, $locBlock)) {
            if($locBlock->playerId==$locPlayer->playerId
                    || ($locBlock->playerId == 0 && $locZone->atLeastOneZoneIsOwn($locPlayer->playerId, 1, 1, 1))) {
                if((($locZone->zoneType == Constante::$ZONE_TYPE_PLAIN)
                        && !$locZone->isOccuped())
                        || $locZone->isHole()
                        || ($locZone->zoneType == DungeonConstante::$ZONE_TYPE_STONE)
                        || ($locZone->zoneType == DungeonConstante::$ZONE_TYPE_ROCK)) {
                    $this->setNewZoneType($locZone, DungeonConstante::$ZONE_TYPE_STONE, DungeonConstante::$ACTION_BUY_STONE_COST);
                } else {
                    $locManageAction->addPlayerInfo("Target zone is not free (or not rock)");
                }
            } else {
                $locManageAction->addPlayerInfo("You are not authorized to build here");
            }
        }
        */
}
?>
Return current item: PhpBlock