game2005api/webapp/mt/SeasonCard.php
aozhiwei 2c47da7ce5 1
2021-12-03 14:18:05 +08:00

41 lines
809 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']);
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;
}