60 lines
1.1 KiB
PHP
60 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace mt;
|
|
|
|
use phpcommon;
|
|
|
|
class Player {
|
|
|
|
|
|
public static function get($equipId)
|
|
{
|
|
return self::getMeta()[$equipId];
|
|
}
|
|
|
|
protected static function getMeta()
|
|
{
|
|
if (!self::$meta) {
|
|
self::$meta = getMetaTable('player@player.php');
|
|
}
|
|
return self::$meta;
|
|
}
|
|
public static function getShopCfg()
|
|
{
|
|
$shopCfgArr = self::getMeta();
|
|
|
|
return $shopCfgArr;
|
|
}
|
|
public static function getPlayerCfgByID($itemID)
|
|
{
|
|
$playerCfg = self::getMeta();
|
|
$itemData = null;
|
|
if($playerCfg[$itemID])
|
|
{
|
|
$itemData = $playerCfg[$itemID];
|
|
}
|
|
|
|
return $itemData;
|
|
|
|
|
|
}
|
|
public static function getPlayerCfgByGoodsID($_itemID)
|
|
{
|
|
$playerCfg = self::getMeta();
|
|
$itemData = null;
|
|
foreach($playerCfg as $item)
|
|
{
|
|
$tmpItemID = $item["itemid"];
|
|
if($tmpItemID == $_itemID)
|
|
{
|
|
$itemData = $item;
|
|
break;
|
|
}
|
|
}
|
|
return $itemData;
|
|
}
|
|
protected static $itemArr;
|
|
protected static $meta;
|
|
|
|
}
|