Exemplo n.º 1
0
ini_set('display_errors', '1');
// session_start();
require_once '../php/EPConfigFile.php';
require_once '../php/EPListProvider.php';
require_once '../php/EPPersistentDataManager.php';
require_once '../php/EPConfigFile.php';
require_once '../php/EPAptitude.php';
require_once '../php/EPSkill.php';
require_once '../php/EPAi.php';
require_once '../php/EPStat.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$configValues = new EPConfigFile('./config.ini');
$_SESSION['aiList'] = $epListP->getListAi();
$_SESSION['aptList'] = $epListP->getListAptitudes();
$_SESSION['skillList'] = $epListP->getListSkills($_SESSION['aptList']);
$_SESSION['statList'] = $epListP->getListStats($configValues, $_SESSION['cc']);
if (isset($_POST['addAi'])) {
    $aptListInject = array();
    foreach ($_SESSION['aptList'] as $m) {
        if (isset($_POST['check_' . $m->abbreviation])) {
            $apatObj = $epListP->getAptitudeByName($_POST['check_' . $m->abbreviation]);
            $apatObj->value = $_POST['val_' . $m->abbreviation];
            array_push($aptListInject, $apatObj);
        }
    }
    $sklListInject = array();
    foreach ($_SESSION['skillList'] as $n) {
        $name_spaceless = str_replace(" ", "_", $n->name);
        if (isset($_POST['check_' . $name_spaceless])) {
            $skillObj = $epListP->getSkillByNamePrefix($_POST['check_' . $name_spaceless], $_POST['prefix_' . $name_spaceless], $_SESSION['aptList']);
Exemplo n.º 2
0
 echo "<br><br>ADDING SKILL  --------------------------------------------- <br><br>";
 $sk = array();
 $sk[0] = new EPSkill("Music", "Concern all about music theory", $aptitudeList[EPAptitude::$INTUITION], EPSkill::$KNOWLEDGE_SKILL_TYPE, EPSkill::$NO_DEFAULTABLE, "Art", array("Musician Base Knowledge", "Rocker Pack", "Priest base"));
 $sk[1] = new EPSkill("Blades", "Hand weapon", $aptitudeList[EPAptitude::$SOMATICS], EPSkill::$ACTIVE_SKILL_TYPE, EPSkill::$NO_DEFAULTABLE, "", array("Weapons", "Weapon Melee"));
 $sk[2] = new EPSkill("Beam Weapons", "All energy weapons", $aptitudeList[EPAptitude::$COORDINATION], EPSkill::$ACTIVE_SKILL_TYPE, EPSkill::$NO_DEFAULTABLE, "", array("Weapons", "Weapon Ranged"));
 $sk[3] = new EPSkill("Climbing", "Spider man", $aptitudeList[EPAptitude::$SOMATICS], EPSkill::$ACTIVE_SKILL_TYPE, EPSkill::$NO_DEFAULTABLE, "", array("Physical", "Acrobatic"));
 foreach ($sk as $s) {
     if (!$persistManager->persistSkill($s)) {
         echo $persistManager->getLastError();
         echo "<br>";
     } else {
         echo "DONE ! <br>";
     }
 }
 //Echo skill list
 $skillList = $listProvider->getListSkills($aptitudeList);
 if ($skillList == null) {
     echo $listProvider->getLastError();
     echo "<br>";
 } else {
     echo "<br><br>SKILL LIST --------------------------------------------- <br><br>";
     foreach ($skillList as $m) {
         echo $m->prefix . ":" . $m->name . " - " . $m->description . " - Apt : " . $m->linkedApt->abbreviation . " - Skill Type : " . $m->skillType . " - Defaultable : " . $m->defaultable . "<br>";
         echo "Skill on groups : <br>";
         $groupsList = $m->groups;
         foreach ($groupsList as $g) {
             echo "-> " . $g;
             echo '<br>';
         }
     }
 }
Exemplo n.º 3
0
        <?php 
error_reporting(E_ALL);
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/EPSkill.php';
require_once '../php/EPAptitude.php';
$epListP = new EPListProvider('../php/config.ini');
$persistManager = new EPPersistentDataManager('../php/config.ini');
$_SESSION['prefixList'] = $epListP->getListPrefix();
$_SESSION['groupsList'] = $epListP->getListGroups();
$_SESSION['skillList'] = $epListP->getListSkills($epListP->getListAptitudes());
if (isset($_POST['addSkill'])) {
    $glistInject = array();
    if (isset($_POST['selectedGroups'])) {
        foreach ($_POST['selectedGroups'] as $g) {
            array_push($glistInject, $g);
        }
    }
    $arrayNewGroups = explode(";", $_POST['newGroups']);
    foreach ($arrayNewGroups as $h) {
        array_push($glistInject, $h);
    }
    $skill = new EPSkill($_POST['name'], $_POST['desc'], $epListP->getAptitudeByAbbreviation($_POST['linkedApt']), $_POST['type'], $_POST['defaultable'], $_POST['prefix'], $glistInject);
    if (!$persistManager->persistSkill($skill)) {
        echo $persistManager->getLastError();
        echo "<br><br>";