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


PHP Shadowrun4::getCityByAbbrev方法代码示例

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


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

示例1: getLocationByAbbrev

 /**
  * @param string $cityname
  * @param string $arg
  * @return SR_Location
  */
 public static function getLocationByAbbrev($cityname, $arg)
 {
     $player = Shadowrun4::getCurrentPlayer();
     if (false !== ($c = Common::substrUntil($arg, '_', false))) {
         $cityname = $c;
         $arg = Common::substrFrom($arg, '_', $arg);
     }
     if (false === ($city = Shadowrun4::getCityByAbbrev($cityname))) {
         self::reply($player, 'Unknown city: ' . $cityname);
         return false;
     }
     $city instanceof SR_City;
     return $city->getLocationByAbbrev($arg);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:gml.php

示例2: execute

 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     $party = $player->getParty();
     $city = false;
     if (count($args) >= 1) {
         if (is_numeric($args[0])) {
             $city = Shadowrun4::getCityByID($args[0]);
         } else {
             $city = Shadowrun4::getCityByAbbrev($args[0]);
         }
     } else {
         $city = $party->getCityClass();
     }
     if ($city === false) {
         return self::reply($player, 'Error: Cannot get city class for your party!');
     }
     $cityname = $city->getName();
     return self::rply($player, '5007', array($cityname, Shadowfunc::getKnownPlaces($player, $cityname)));
     // 		$bot->reply(sprintf('Known Places in %s: %s.', $cityname, Shadowfunc::getKnownPlaces($player, $cityname)));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:22,代码来源:known_places.php

示例3: displayMissing

 /**
  * Display classnames of missing quests in a city.
  * @param SR_Player $player
  * @param array $quests
  * @param array $args
  * @return true
  */
 private static function displayMissing(SR_Player $player, array $quests, array $args)
 {
     if (count($args) === 1) {
         $args[] = $player->getParty()->getCity();
     }
     if (count($args) !== 2) {
         return self::reply($player, Shadowhelp::getHelp($player, 'quests'));
     }
     if (false === ($city = Shadowrun4::getCityByAbbrev($args[1]))) {
         return self::reply($player, Shadowhelp::getHelp($player, 'quests'));
     }
     $cityname = $city->getName();
     $names = array();
     $all = SR_Quest::getQuests();
     foreach ($all as $classname => $quest) {
         $quest instanceof SR_Quest;
         if ($quest->getCityName() !== $cityname) {
             continue;
         }
         $q2 = SR_Quest::getQuest($player, $quest->getVar('sr4qu_name'));
         if ($q2->isUnknown($player)) {
             $names[] = Common::substrFrom($classname, '_', $classname);
         }
     }
     return self::rply($player, '5265', array($cityname, GWF_Array::implodeHuman($names)));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:33,代码来源:quests.php


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