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);
        }
    }
    if (isset($_POST['selectedGear'])) {
Exemplo n.º 2
0
 }
 //Adding PsySleight
 echo "<br><br>ADDING PSY SLEIGHT  ---------------------------------- <br><br>";
 $bonusMalusListPsy = $listProvider->getListBonusMalus();
 $psy[0] = new EPPsySleight("Psy Sleight Test", "desc desc desc desc", EPPsySleight::$ACTIVE_PSY, EPPsySleight::$RANGE_SELF, EPPsySleight::$DURATION_SUSTAINED, EPPsySleight::$ACTION_COMPLEX, 42, $bonusMalusListPsy);
 foreach ($psy as $a) {
     if (!$persistManager->persistPsySleight($a)) {
         echo $persistManager->getLastError();
         echo "<br>";
     } else {
         echo "DONE ! <br>";
     }
 }
 //Eco PsySleight
 echo "<br><br>PSY SLEIGHT LIST------------------------------------------ <br><br>";
 $psyList = $listProvider->getListPsySleights();
 if ($psyList == null) {
     echo $listProvider->getLastError();
     echo "<br>";
 } else {
     foreach ($psyList as $m) {
         echo $m->name . " : " . $m->description . " data : " . $m->range . " -- " . $m->psyType . " -- " . $m->duration . " -- " . $m->action . " -- " . $m->strainMod;
         echo '<br>';
         echo '<br>';
         $bonusMalus = $m->bonusMalus;
         echo "With Bonus malus : <br>";
         foreach ($bonusMalus as $o) {
             echo $o->name . " Desc : " . $o->description . "<br>";
         }
         echo '<br>';
         echo '<br>';