Exemplo n.º 1
0
     echo "<br>";
 } else {
     echo "Bonus Malus added ! <br>";
 }
 if (!$persistManager->deleteBonusMalus($delBm->name)) {
     echo $persistManager->getLastError();
     echo "<br>";
 } else {
     echo "Bonus Malus Deleted ! <br>";
 }
 //Gear
 echo "<br><br>GEAR DELETION------------------------------------------ <br><br>";
 $delbm = new EPBonusMalus("COG 5 Bonus", EPBonusMalus::$ON_APTITUDE, 5);
 $delbonusMalusArray = array($delbm);
 $toDelGear = new EPGear("TODELETE", "Gear Not existing in the rule, just for test", EPGear::$SOFT_GEAR, EPCreditCost::$HIGH, 2, 2, 0, 0, $delbonusMalusArray);
 if (!$persistManager->persistGear($toDelGear)) {
     echo $persistManager->getLastError();
     echo "<br>";
 } else {
     echo "Gear added ! <br>";
 }
 if (!$persistManager->deleteGear($toDelGear->name)) {
     echo $persistManager->getLastError();
     echo "<br>";
 } else {
     echo "Gear Deleted ! <br>";
 }
 //Morph
 echo "<br><br>MORPH DELETION------------------------------------------ <br><br>";
 $todeletetraitList = array(new EPTrait("TODELETE1", "", EPTrait::$POSITIVE_TRAIT, EPTrait::$EGO_TRAIT, 11));
 $todeletegearListMorph = array(new EPGear("TODELETE2", "", EPGear::$SOFT_GEAR, EPCreditCost::$HIGH));
Exemplo n.º 2
0
    $arm_p = "0";
    if (!empty($_POST['armorPenetration'])) {
        $arm_p = $_POST['armorPenetration'];
    }
    $degat = "0";
    if (!empty($_POST['degat'])) {
        $degat = $_POST['degat'];
    }
    if ($_POST['unique'] == "Y") {
        $u = true;
    } else {
        $u = false;
    }
    $newGear = new EPGear($_POST['name'], $_POST['desc'], $_POST['gType'], $_POST['cost'], $arm_k, $arm_e, $degat, $arm_p, $bmlistInject, $_POST['isFor']);
    $newGear->unique = $u;
    if (!$persistManager->persistGear($newGear)) {
        echo $persistManager->getLastError();
        echo "<br><br>";
    } else {
        $_SESSION['gearList'] = $epListP->getListGears();
        echo "<b> Gear Added ! </b><br><br>";
    }
} else {
    if (isset($_POST['deleteGear'])) {
        if (!$persistManager->deleteGear($_POST['deleteGear'])) {
            echo $persistManager->getLastError();
            echo "<br><br>";
        } else {
            $_SESSION['gearList'] = $epListP->getListGears();
            echo "<b> Gear Deleted ! </b><br><br>";
        }