/** * @param Client $client * @param Mode $mode * @param string $serverUrl */ function __construct(Robot $robot, Mode $gameMode = null, $serverUrl = null) { $this->robot = $robot; $this->client = new Client(new Server($robot->secretKey())); $this->state = $this->client->createGame($gameMode, $serverUrl); }