error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', '1');
// session_start();
require_once 'EPPersistentDataManager.php';
require_once '../php/EPConfigFile.php';
require_once '../php/EPListProvider.php';
require_once '../php/EPConfigFile.php';
require_once '../php/EPBackground.php';
require_once '../php/EPTrait.php';
require_once '../php/EPGear.php';
require_once '../php/EPPsySleight.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['backgroundList'] = $epListP->getListBackgrounds();
$_SESSION['traitList'] = $epListP->getListTraits();
$_SESSION['gearList'] = $epListP->getListGears();
$_SESSION['psyList'] = $epListP->getListPsySleights();
$_SESSION['morphList'] = $epListP->getListMorph();
$_SESSION['aiList'] = $epListP->getListAi();
if (isset($_POST['addBook'])) {
    $totalInject = array();
    if (isset($_POST['selectedBackground'])) {
        foreach ($_POST['selectedBackground'] as $b) {
            array_push($totalInject, $b);
        }
    }
    if (isset($_POST['selectedTraits'])) {
        foreach ($_POST['selectedTraits'] as $t) {
            array_push($totalInject, $t);
        }
    }
Exemplo n.º 2
0
 echo "<br><br>ADDING GEAR  --------------------------------------------- <br><br>";
 $bonusMalusArray = array($bm1_1, $bm1_2, $bm1_3, $bm2_1, $bm2_2, $bm3_1);
 array_merge($bonusMalusArray, $listProvider->getListBonusMalus());
 $gear[0] = new EPGear("Test Gear 1", "Gear Not existing in the rule, just for test", EPGear::$SOFT_GEAR, EPCreditCost::$HIGH, 2, 2, 0, 0, $bonusMalusArray);
 $gear[1] = new EPGear("Test Gear 2", "Gear Not existing in the rule, just for test", EPGear::$STANDARD_GEAR, EPCreditCost::$MODERATE, 0, 0, 3, 2, $bonusMalusArray);
 foreach ($gear as $g) {
     if (!$persistManager->persistGear($g)) {
         echo $persistManager->getLastError();
         echo "<br>";
     } else {
         echo "DONE ! <br>";
     }
 }
 //Echo Gear list
 echo "<br><br>GEAR LIST------------------------------------------ <br><br>";
 $gearList = $listProvider->getListGears();
 if ($gearList == null) {
     echo $listProvider->getLastError();
     echo "<br>";
 } else {
     foreach ($gearList as $m) {
         echo $m->name . " : " . $m->description . " Type : " . $m->gearType . " Cost : " . $m->getCost() . " Armor kinetic : " . $m->armorKinetic . " Armor energy : " . $m->armorEnergy . " Degats : " . $m->degat . " Armor penetration : " . $m->armorPenetration;
         echo '<br>';
         $malusBonus = $m->bonusMalus;
         echo "With BonusMalus : <br>";
         foreach ($malusBonus as $o) {
             echo $o->name . " - " . $o->description . " - Type : " . $o->bonusMalusType . " - for target : " . $o->forTargetNamed . " - value : " . $o->value . "<br>";
         }
         echo "<br>";
         echo "<br>";
     }