41 lines
841 B
PHP
41 lines
841 B
PHP
<?php
|
|
|
|
|
|
namespace mt;
|
|
|
|
|
|
class BattleReward
|
|
{
|
|
public static function find($typeId,$lucky){
|
|
$reward = array();
|
|
foreach (self::getMetaList() as $meta){
|
|
if ($meta['type'] == $typeId && $lucky >= $meta['luckRangeMin']){
|
|
$reward = $meta;
|
|
}
|
|
}
|
|
return $reward;
|
|
}
|
|
|
|
public static function findByType($typeId){
|
|
$metas = array();
|
|
foreach (self::getMetaList() as $meta){
|
|
if ($meta['type'] == $typeId){
|
|
array_push($metas,$meta);
|
|
}
|
|
}
|
|
return $metas;
|
|
}
|
|
|
|
|
|
|
|
protected static function getMetaList()
|
|
{
|
|
if (!self::$metaList) {
|
|
self::$metaList = getMetaTable('battleReward@battleReward.php');
|
|
}
|
|
return self::$metaList;
|
|
}
|
|
|
|
protected static $metaList;
|
|
|
|
} |