/** * Returns the stats for the given game for the owner of this SteamID * * @param mixed $id The full or short name or the application ID of the * game stats should be fetched for * @return GameStats The statistics for the game with the given name * @throws SteamCondenserException if the user does not own this game or it * does not have any stats */ public function getGameStats($id) { $game = $this->findGame($id); if (!$game->hasStats()) { throw new SteamCondenserException("\"{$game->getName()}\" does not have stats."); } if (empty($this->customUrl)) { return GameStats::createGameStats($this->steamId64, $game->getShortName()); } else { return GameStats::createGameStats($this->customUrl, $game->getShortName()); } }
/** * Creates a stats object for the given user and this game * * @param string $steamId The custom URL or the 64bit Steam ID of the user * @return GameStats The stats of this game for the given user */ public function getUserStats($steamId) { if (!$this->hasStats()) { return null; } return GameStats::createGameStats($steamId, $this->shortName); }