game2006api/webapp/mt/PveGeminiMode.php
aozhiwei 31e9699eea 1
2022-09-17 14:33:26 +08:00

36 lines
731 B
PHP

<?php
namespace mt;
use phpcommon;
class PveGeminiMode {
public static function get($id)
{
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
}
public static function calcStar($meta, $score)
{
$strs = explode('|', $meta['score_reward']);
for ($i = 0; i < count($strs) && $i < 3; ++$i) {
if ($score > $strs[i]) {
return i + 1;
}
}
return 0;
}
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('pveGeminiMode@pveGeminiMode.php');
}
return self::$metaList;
}
protected static $metaList;
}