53 lines
1.1 KiB
PHP
53 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace mt;
|
|
|
|
use phpcommon;
|
|
|
|
class Manufacture {
|
|
const SYN_ACTION = 1;
|
|
const UP_ACTION = 2;
|
|
|
|
public static function get($id)
|
|
{
|
|
return array_key_exists($id, self::getMetaList()) ? self::getMetaList()[$id] : null;
|
|
}
|
|
|
|
|
|
public static function hashChance($chance){
|
|
if (!$chance){
|
|
return array();
|
|
}
|
|
$chanceStr = explode("|",$chance);
|
|
$hashChance = array();
|
|
foreach ($chanceStr as $value){
|
|
$arr = explode(":",$value);
|
|
$hashChance[$arr[0]] = $arr[1];
|
|
}
|
|
return $hashChance;
|
|
}
|
|
|
|
|
|
|
|
public static function getByInvoke($invoke,$quality){
|
|
foreach (self::getMetaList() as $meta){
|
|
if ($meta['invoke'] == $invoke && $meta['rank'] == $quality){
|
|
return $meta;
|
|
}
|
|
}
|
|
return array();
|
|
}
|
|
|
|
|
|
protected static function getMetaList()
|
|
{
|
|
if (!self::$metaList) {
|
|
self::$metaList = getMetaTable('manufacture@manufacture.php');
|
|
}
|
|
return self::$metaList;
|
|
}
|
|
|
|
protected static $metaList;
|
|
|
|
}
|