game2005api/webapp/mt/Player.php
aozhiwei b8bb70a77f 1
2021-06-18 22:23:50 +08:00

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;
}