本文整理汇总了PHP中Neuron_Core_Tools::getResourceToText方法的典型用法代码示例。如果您正苦于以下问题:PHP Neuron_Core_Tools::getResourceToText方法的具体用法?PHP Neuron_Core_Tools::getResourceToText怎么用?PHP Neuron_Core_Tools::getResourceToText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Neuron_Core_Tools
的用法示例。
在下文中一共展示了Neuron_Core_Tools::getResourceToText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUpgradeItem
private function getUpgradeItem($id, $input, $error = null)
{
$this->hideGeneralOptions();
$equipment = $this->getCraftableItem($id);
if (!$equipment) {
return '<p>Item not found.</p>';
}
$page = new Neuron_Core_Template();
if (isset($error)) {
$page->set('error', $error);
}
$page->set('upgradecost', Neuron_Core_Tools::getResourceToText($this->getVillage()->equipment->getIncreaseLevelCost($equipment)));
$page->set('current_level', array('name' => $equipment->getName(), 'cost' => $this->getCost($equipment), 'stats' => Neuron_Core_Tools::output_text($equipment->getStats_text(), false)));
//$equipment->setLevel ($equipment->getLevel () + 1);
$equipment2 = $equipment->getNextLevel();
$page->set('next_level', array('name' => $equipment2->getName(), 'cost' => $this->getCost($equipment2), 'stats' => Neuron_Core_Tools::output_text($equipment2->getStats_text(), false)));
$page->set('buildingid', $this->getId());
$page->set('id', $equipment->getId());
return $page->parse('buildings/crafting_upgrade.phpt');
}
示例2: getResourcesPage
private function getResourcesPage()
{
// Fetch resources
$login = Neuron_Core_Login::__getInstance();
if ($login->isLogin() && Neuron_GameServer::getPlayer()->isPlaying()) {
$me = Neuron_GameServer::getPlayer();
$village = $me->getCurrentVillage();
if ($village) {
$resources = $village->resources->getResources();
$income = $village->resources->getIncome();
$capacity = $village->resources->getCapacity();
return Neuron_Core_Tools::getResourceToText($resources, $income, $capacity, true);
}
}
return null;
}