当前位置: 首页>>代码示例>>PHP>>正文


PHP Globals::getRaceName方法代码示例

本文整理汇总了PHP中Globals::getRaceName方法的典型用法代码示例。如果您正苦于以下问题:PHP Globals::getRaceName方法的具体用法?PHP Globals::getRaceName怎么用?PHP Globals::getRaceName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Globals的用法示例。


在下文中一共展示了Globals::getRaceName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<?php

$raceName = Globals::getRaceName($var['race_id']);
$template->assign('PageTopic', 'Send message to ruling council of the ' . $raceName);
require_once get_file_loc('menu.inc');
create_message_menu();
$PHP_OUTPUT .= '<p>';
$container = create_container('council_send_message_processing.php');
transfer('race_id');
$PHP_OUTPUT .= create_echo_form($container);
$PHP_OUTPUT .= '<p><small><b>From:</b> ' . $player->getPlayerName() . ' (' . $player->getPlayerID() . ')<br />';
$PHP_OUTPUT .= '<b>To:</b> Ruling Council of ' . $raceName . '</small></p>';
$PHP_OUTPUT .= '<textarea spellcheck="true" name="message" id="InputFields"></textarea><br /><br />';
$PHP_OUTPUT .= create_submit('Send message');
$PHP_OUTPUT .= '</form>';
$PHP_OUTPUT .= '</p>';
开发者ID:smrealms,项目名称:smrv2.0,代码行数:16,代码来源:council_send_message.php

示例2: get_file_loc

<?php

require_once get_file_loc('menu.inc');
if (!isset($var['race_id'])) {
    SmrSession::updateVar('race_id', $player->getRaceID());
}
$raceID = $var['race_id'];
$template->assign('PageTopic', 'Ruling Council Of ' . Globals::getRaceName($raceID));
// echo menu
create_council_menu($raceID);
$RACES =& Globals::getRaces();
$raceRelations =& Globals::getRaceRelations($player->getGameID(), $raceID);
$peaceRaces = array();
$neutralRaces = array();
$warRaces = array();
foreach ($RACES as $otherRaceID => $raceInfo) {
    if ($otherRaceID != RACE_NEUTRAL && $raceID != $otherRaceID) {
        if ($raceRelations[$otherRaceID] >= 300) {
            $peaceRaces[$otherRaceID] = $raceInfo;
        } else {
            if ($raceRelations[$otherRaceID] <= -300) {
                $warRaces[$otherRaceID] = $raceInfo;
            } else {
                $neutralRaces[$otherRaceID] = $raceInfo;
            }
        }
    }
}
$template->assignByRef('PeaceRaces', $peaceRaces);
$template->assignByRef('NeutralRaces', $neutralRaces);
$template->assignByRef('WarRaces', $warRaces);
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:council_politics.php

示例3: inify

    $file .= inify($weapon->getName()) . '=' . inify($weapon->getRaceName()) . ',' . $weapon->getCost() . ',' . $weapon->getShieldDamage() . ',' . $weapon->getArmourDamage() . ',' . $weapon->getBaseAccuracy() . ',' . $weapon->getPowerLevel() . ',' . $weapon->getEmpDamage() . ',' . $weapon->getBuyerRestriction() . ',' . ($weapon->isRaidWeapon() ? '1' : '0') . EOL;
}
unset($weapon);
$file .= '[ShipEquipment]
; Name = Cost' . EOL;
$hardwares =& Globals::getHardwareTypes();
foreach ($hardwares as &$hardware) {
    $file .= inify($hardware['Name']) . '=' . $hardware['Cost'] . EOL;
}
unset($hardware);
$file .= '[Ships]
; Name = Race,Cost,TPH,Hardpoints,Power,+Equipment (Optional),+Restrictions(Optional)
; Restrictions:Align(Integer)' . EOL;
$ships =& AbstractSmrShip::getAllBaseShips($gameID);
foreach ($ships as &$ship) {
    $file .= inify($ship['Name']) . '=' . Globals::getRaceName($ship['RaceID']) . ',' . $ship['Cost'] . ',' . $ship['Speed'] . ',' . $ship['Hardpoint'] . ',' . $ship['MaxPower'];
    if ($ship['MaxHardware'] > 0) {
        $shipEquip = ',ShipEquipment=';
        foreach ($ship['MaxHardware'] as $hardwareID => $maxHardware) {
            $shipEquip .= $hardwares[$hardwareID]['Name'] . '=' . $maxHardware . ';';
        }
        $file .= substr($shipEquip, 0, -1);
        $file .= ',Restrictions=' . $ship['AlignRestriction'];
    }
    $file .= EOL;
}
unset($ship);
$file .= '[Locations]
; Name = +Sells' . EOL;
$locations =& SmrLocation::getAllLocations();
foreach ($locations as &$location) {
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:smr_file_create.php


注:本文中的Globals::getRaceName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。