GameResource

final public class GameResource: ResourceUpdating

A class representing a Game on the Giant Bomb wiki. Examples include Farcry 3 and Splatoon. To retrieve information about a specific release of a game, see GameReleaseResource.

To retrieve extended info for a game, call fetchExtendedInfo(_:) upon it.

  • The resource type.

    Declaration

    Swift

    public let resourceType = ResourceType.game
  • Array of aliases the game is known by.

    Declaration

    Swift

    public fileprivate(set) var aliases: [String]?
  • URL pointing to the game detail resource.

    Declaration

    Swift

    public fileprivate(set) var api_detail_url: URL?
  • Date the game was added to Giant Bomb.

    Declaration

    Swift

    public fileprivate(set) var date_added: Date?
  • Date the game was last updated on Giant Bomb.

    Declaration

    Swift

    public fileprivate(set) var date_last_updated: Date?
  • Brief summary of the game.

    Declaration

    Swift

    public fileprivate(set) var deck: String?
  • Description of the game.

    Declaration

    Swift

    public fileprivate(set) var description: String?
  • Expected date the game will be released. Only contains the month and year. Fetch extended info for the full date.

    Declaration

    Swift

    public fileprivate(set) var expected_release_date: Date?
  • id

    Unique ID of the game.

    Declaration

    Swift

    public let id: Int?
  • Main image of the game.

    Declaration

    Swift

    public fileprivate(set) var image: ImageURLs?
  • Name of the game.

    Declaration

    Swift

    public fileprivate(set) var name: String?
  • Number of user reviews of the game on Giant Bomb.

    Declaration

    Swift

    public fileprivate(set) var number_of_user_reviews: Int?
  • Rating of the first release of the game.

    Declaration

    Swift

    public fileprivate(set) var original_game_rating: [(id: Int, name: String)]?
  • Date the game was first released.

    Declaration

    Swift

    public fileprivate(set) var original_release_date: Date?
  • The platforms the game exists on.

    Declaration

    Swift

    public fileprivate(set) var platforms: [PlatformResource]?
  • URL pointing to the game on Giant Bomb.

    Declaration

    Swift

    public fileprivate(set) var site_detail_url: URL?
  • A staff review by a member of the Giant Bomb team for the game. Fetch by calling fetchStaffReview(_:) upon a game. Note, however, that most games in the database don’t have a staff review.

    Declaration

    Swift

    public internal(set) var staffReview: StaffReviewResource?
  • Extended info.

    Declaration

    Swift

    public var extendedInfo: GameExtendedInfo?
  • Used to create a GameResource from JSON.

    Declaration

    Swift

    public init(json: [String : AnyObject])
  • Pretty description of the game.

    Declaration

    Swift

    public var prettyDescription: String
  • Fetches extended info for this game. Also re-populates base data in the case where this object is a stub from another parent resource.

    Declaration

    Swift

    public func fetchExtendedInfo(_ fields: [String]? = nil, completion: @escaping (_ error: RequestError?) -> Void)

    Parameters

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-14. Pass nil to return everything.

    completion

    A closure containing an optional RequestError if the request failed.

  • Fetches the Giant Bomb staff review (if one was written) for this game.

    Declaration

    Swift

    public func fetchStaffReview(_ fields: [String]? = nil, completion: @escaping (_ error: RequestError?) -> Void) -> Void

    Parameters

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-36. Pass nil to return everything.

    completion

    A closure containing an optional RequestError if the request failed.