41 lines
813 B
PHP
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;
|
|
|
|
}
|