當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Unit::setBattleMods方法代碼示例

本文整理匯總了PHP中Unit::setBattleMods方法的典型用法代碼示例。如果您正苦於以下問題:PHP Unit::setBattleMods方法的具體用法?PHP Unit::setBattleMods怎麽用?PHP Unit::setBattleMods使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Unit的用法示例。


在下文中一共展示了Unit::setBattleMods方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: BattleMod

    $battleModName = $terms[$battleModArr[1]];
    $battleMod = new BattleMod($battleModArr[0], $battleModName, $battleModArr[2], $battleModArr[3], $battleModArr[4], $battleModArr[5]);
    $battleMods[$battleMod->getId()] = $battleMod;
}
//Saves battleModLinks as $posessorUnit->targetUnit->battleMod applied to it
$battleModLinksArr = $battleModConn->getAllBattleModLinks();
foreach ($battleModLinksArr as $battleModLinkArr) {
    $battleModLinks[$battleModLinkArr[2]][$battleMods[$battleModLinkArr[1]]->getTargetClassId()] = $battleMods[$battleModLinkArr[1]];
}
$unitsArr = $unitConn->getAllUnits();
foreach ($unitsArr as $unitArr) {
    $unitName = $terms[$unitArr[1]]->getString();
    $unitDescription = $terms[$unitArr[13]]->getString();
    $unit = new Unit($unitArr[0], $unitName, $unitArr[2], $unitArr[3], $unitArr[4], $unitArr[5], $unitArr[6], $unitArr[7], $unitArr[8], explode(",", $unitArr[9]), explode(",", $unitArr[10]), explode(",", $unitArr[11]), $unitArr[12], $unitDescription, $unitArr[14], $unitArr[15]);
    if (isset($battleModLinks[$unit->getId()])) {
        $unit->setBattleMods($battleModLinks[$unit->getId()]);
    }
    $units[$unit->getId()] = $unit;
}
$staticData->setUnits($units);
$technologiesArr = $technologyConn->getAllTechnologies();
foreach ($technologiesArr as $technologyArr) {
    $techName = $terms[$technologyArr[1]]->getString();
    $techDescription = $terms[$technologyArr[11]]->getString();
    $technology = new Technology($technologyArr[0], $techName, $technologyArr[2], $technologyArr[3], $technologyArr[4], explode(",", $technologyArr[5]), explode(",", $technologyArr[6]), $technologyArr[7], $technologyArr[8], $technologyArr[9], $technologyArr[10], $techDescription, $technologyArr[12]);
    $technologies[$technology->getId()] = $technology;
}
$staticData->setTechnologies($technologies);
$productionModsArr = $productionModConn->getAllProductionMods();
$productionModLinks = array();
foreach ($productionModsArr as $productionModArr) {
開發者ID:LordMatrix,項目名稱:Ochorri,代碼行數:31,代碼來源:initStaticData.php


注:本文中的Unit::setBattleMods方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。