本文整理汇总了PHP中Neuron_Core_Tools::floor_array方法的典型用法代码示例。如果您正苦于以下问题:PHP Neuron_Core_Tools::floor_array方法的具体用法?PHP Neuron_Core_Tools::floor_array怎么用?PHP Neuron_Core_Tools::floor_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Neuron_Core_Tools
的用法示例。
在下文中一共展示了Neuron_Core_Tools::floor_array方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIncome
public function getIncome($since = NOW, $now = NOW)
{
$profiler = Neuron_Profiler_Profiler::getInstance();
$profiler->start('Calculating income for this ' . $this->getClassName());
$o = array($this->RESOURCE => $this->calculateIncome());
$profiler->start('Processing bonus effects');
$o = Neuron_Core_Tools::floor_array($this->getVillage()->procBonusses('procIncome', array($o, $this), $now, $since));
$profiler->stop();
$profiler->stop();
return $o;
}
示例2: calculateCapacity
private function calculateCapacity($l = null)
{
$o = array();
if (!isset($l)) {
$l = $this->getLevel();
}
$c = 8000;
// Percentage that the capacity "grows" per level
$g = 10;
$capacity = $l * $c + $l * $c / 100 * ($l - 1) * $g;
$o['gold'] = $capacity;
$o['grain'] = $capacity;
$o['wood'] = $capacity;
$o['stone'] = $capacity;
$o['iron'] = $capacity;
$o['gems'] = floor($capacity / 10);
return Neuron_Core_Tools::floor_array($this->getVillage()->procBonusses('procCapacity', array($o, $this)));
}