You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
633 B
PHP
27 lines
633 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Helper\RebateGiftItem;
|
|
|
|
use App\Exception\BusinessException;
|
|
|
|
class Manager
|
|
{
|
|
private function getGameItemClassMap() {
|
|
return [
|
|
11 => Game11::class,
|
|
17 => Game17::class,
|
|
21 => Game21::class,
|
|
];
|
|
}
|
|
|
|
public function getTypeItemsMap($baseGameId) {
|
|
$gameItemClass = $this->getGameItemClassMap()[$baseGameId] ?: null;
|
|
if (empty($gameItemClass)) {
|
|
throw new BusinessException('GameItem类不存在');
|
|
}
|
|
$gameItem = new $gameItemClass();
|
|
return $gameItem->getAllItems();
|
|
}
|
|
} |