function loadSavePack($savePack, $cc = null) { parent::loadSavePack($savePack); foreach ($savePack['aptitudesSavePacks'] as $m) { $savedAptitude = new EPAptitude('', ''); $savedAptitude->loadSavePack($m); array_push($this->aptitudes, $savedAptitude); } foreach ($savePack['skillsSavePacks'] as $m) { $savedSkill = new EPSkill('', '', '', '', ''); $savedSkill->loadSavePack($m); array_push($this->skills, $savedSkill); } foreach ($savePack['statsSavePacks'] as $m) { $savedStat = new EPStat('', '', '', 0, $cc); $savedStat->loadSavePack($m); array_push($this->stats, $savedStat); } foreach ($savePack['bmSavePacks'] as $m) { $savedBm = new EPBonusMalus('', '', ''); $savedBm->loadSavePack($m); array_push($this->bonusMalus, $savedBm); } }
function loadSavePack($savePack, $cc = null) { $this->name = $savePack['name']; $this->creditInstant = $savePack['creditInstant']; $this->credit = $savePack['credit']; $this->creditMorphMod = $savePack['creditMorphMod']; $this->creditTraitMod = $savePack['creditTraitMod']; $this->creditFactionMod = $savePack['creditFactionMod']; $this->creditBackgroundMod = $savePack['creditBackgroundMod']; $this->creditSoftGearMod = $savePack['creditSoftGearMod']; $this->creditPsyMod = $savePack['creditPsyMod']; $this->creditPurchased = $savePack['creditPurchased']; if ($savePack['factionSavePack'] != null) { $faction = new EPBackground('', '', ''); $faction->loadSavePack($savePack['factionSavePack']); $this->faction = $faction; } if ($savePack['backgroundSavePack'] != null) { $faction = new EPBackground('', '', ''); $faction->loadSavePack($savePack['backgroundSavePack']); $this->background = $faction; } foreach ($savePack['motivationArray'] as $m) { array_push($this->motivations, $m); } //must be done befor skills ! $this->aptitudes = array(); foreach ($savePack['aptitudesSavePacks'] as $m) { $savedAptitude = new EPAptitude('', ''); $savedAptitude->loadSavePack($m); array_push($this->aptitudes, $savedAptitude); } foreach ($savePack['skillsSavePacks'] as $m) { $savedSkill = new EPSkill('', '', '', '', ''); $savedSkill->loadSavePack($m); array_push($this->skills, $savedSkill); } $this->reputations = array(); foreach ($savePack['reputationSavePack'] as $m) { $savedRep = new EPReputation('', ''); $savedRep->loadSavePack($m); array_push($this->reputations, $savedRep); } foreach ($savePack['statsSavePacks'] as $m) { $savedStat = new EPStat('', '', '', 0, $cc); $savedStat->loadSavePack($m); array_push($this->stats, $savedStat); } foreach ($savePack['traitSavePacks'] as $m) { $savedTrait = new EPTrait('', '', '', '', ''); $savedTrait->loadSavePack($m); array_push($this->traits, $savedTrait); } foreach ($savePack['additionaTraitsSavePacks'] as $m) { $savedAddTrait = new EPTrait('', '', '', '', ''); $savedAddTrait->loadSavePack($m); array_push($this->additionalTraits, $savedAddTrait); } foreach ($savePack['softGearSavePacks'] as $m) { $savedSoftG = new EPGear('', '', '', ''); $savedSoftG->loadSavePack($m); array_push($this->softGears, $savedSoftG); } foreach ($savePack['aiSavePacks'] as $m) { $savedAi = new EPAi('', array(), ''); $savedAi->loadSavePack($m, $cc); array_push($this->ais, $savedAi); } foreach ($savePack['defaultAisSavePacks'] as $m) { $defSavedAi = new EPAi('', array(), ''); $defSavedAi->loadSavePack($m, $cc); array_push($this->defaultAis, $defSavedAi); } foreach ($savePack['psySleightSavePacks'] as $m) { $savedPsyS = new EPPsySleight('', '', '', '', '', '', '', ''); $savedPsyS->loadSavePack($m); array_push($this->psySleights, $savedPsyS); } }