本文整理汇总了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>';
示例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);
示例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) {