37 lines
727 B
PHP
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;
|
|
|
|
}
|