JtxcClient::class, 192 => JtxcClient::class, 231 => LsxxClient::class, 232 => LsxxClient::class, 229 => YzchzbClient::class, 230 => YzchzbClient::class, ]; public function __construct($game) { $this->game = $game; $this->client = $this->createClient(); } private function createClient() { $clientClass = ''; $gameId = intval($this->game['id']); if (isset($this->clientMap[$gameId])) { $clientClass = $this->clientMap[$gameId]; } else { throw new \Exception('游戏资源客户端未配置'); } return new $clientClass(); } public function getResourceTypes() { $deviceType = $this->game['sdk_version'] == 1 ? 'andriod' : 'ios'; return $this->client->getResourceTypes($deviceType); } public function getResources($typeId = null) { $deviceType = $this->game['sdk_version'] == 1 ? 'andriod' : 'ios'; return $this->client->getResources($typeId, $deviceType); } public function apply($order, $role) { return $this->client->apply($order, $role); } }