game2005api/webapp/mt/SeasonCard.php
aozhiwei 279dbe96fc 1
2021-12-10 17:50:09 +08:00

41 lines
813 B
PHP

<?php
namespace mt;
use phpcommon;
class SeasonCard {
public static function get($id)
{
return getXVal(self::getMetaList(), $id);
}
public static function getInitCard()
{
return self::get(1);
}
public static function calcCost($currMeta, $newMeta)
{
$cost = 0;
$nextMeta = self::get($currMeta['lv'] + 1);
while ($nextMeta && $nextMeta['lv'] <= $newMeta['lv']) {
$cost += $nextMeta['cost'];
$nextMeta = self::get($nextMeta['lv'] + 1);
}
return $cost;
}
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('seasonCard@seasonCard.php');
}
return self::$metaList;
}
protected static $metaList;
}