game2006api/webapp/mt/FormulaPvp.php
aozhiwei 0b7ce1e64f 1
2022-05-25 23:20:56 +08:00

37 lines
727 B
PHP

<?php
namespace mt;
use phpcommon;
class FormulaPvp {
public static function get($id)
{
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
}
public static function getByRanked($rankedTopX)
{
$lastMeta = null;
foreach (self::getMetaList() as $meta) {
$lastMeta = $meta;
if ($rankedTopX <= $meta['top']) {
return $meta;
}
}
return $lastMeta;
}
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('pvp@formula.php');
}
return self::$metaList;
}
protected static $metaList;
}