struct Srcom::Game

Overview

Has shorthand methods to getting the resources that the Links in #links point to. Does not cover the Link to get the applicable Levels, Categorys, or Variables, since those are already embedded.

NOTE Also does not cover romhacks, since the endpoint is deprecated and synonymous with derived-games.

Included Modules

Defined in:

srcr/mappings/game/game.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def abbreviation : String #

[View source]
def abbreviation=(abbreviation : String) #

[View source]
def assets : Game::Assets #

[View source]
def assets=(assets : Game::Assets) #

[View source]
def base_game : Game? #

Returns the Game this Game is derived from, if it is a derived game.


[View source]
def categories : Array(Category) #

[View source]
def categories=(categories : Array(Category)) #

[View source]
def created : Time? #

[View source]
def created=(created : Time?) #

[View source]
def derived_games(page_size : Int32 = 200) : Srcom::Api::PageIterator(Game) #

Returns all Games derived from this Game.


[View source]
def developers : Array(Developer) #

[View source]
def developers=(developers : Array(Developer)) #

[View source]
def engines : Array(Engine) #

[View source]
def engines=(engines : Array(Engine)) #

[View source]
def gametypes : Array(Game::Gametype) #

[View source]
def gametypes=(gametypes : Array(Game::Gametype)) #

[View source]
def genres : Array(Genre) #

[View source]
def genres=(genres : Array(Genre)) #

[View source]
def id : String #

[View source]
def id=(id : String) #

[View source]
def leaderboard : Leaderboard #

Returns the Leaderboard for the Category that is first shown when this Game is visited on speedrun.com.


[View source]
def levels : Array(Level) #

[View source]
def levels=(levels : Array(Level)) #

[View source]
def links : Array(Link) #

[View source]
def links=(links : Array(Link)) #

[View source]
def moderators : Array(User) #

[View source]
def moderators=(moderators : Array(User)) #

[View source]
def name #

Shorthand for Name#international.

NOTE This method is present on all things that have the international + japanese name structure.


[View source]
def names : Game::Name #

[View source]
def names=(names : Game::Name) #

[View source]
def platforms : Array(Platform) #

[View source]
def platforms=(platforms : Array(Platform)) #

[View source]
def publishers : Array(Publisher) #

[View source]
def publishers=(publishers : Array(Publisher)) #

[View source]
def records(top : Int32 = 3, scope : String = "all", miscellaneous : Bool = true, skip_empty : Bool = false, page_size : Int32 = 200) : Srcom::Api::PageIterator(Leaderboard) #

Gets every Leaderboard with the top N runs for this Game, skipping over empty Leaderboards if skip_empty is true.

If miscellaneous is set to false, only Leaderboards for non-miscellaneous categories will be returned. If it is set to true Leaderboards for both miscellaneous and non-miscellaneous categories will be returned.

This method defaults to getting everything, as it is doubtful a single Game will have truly that many Leaderboards.

NOTE This can result in more than N runs per Leaderboard, as ties can occur.


[View source]
def regions : Array(Region) #

[View source]
def regions=(regions : Array(Region)) #

[View source]
def release_date : Time #

[View source]
def release_date=(release_date : Time) #

[View source]
def released : Int32 #

[View source]
def released=(released : Int32) #

[View source]
def romhack : Bool #

[View source]
def romhack=(romhack : Bool) #

[View source]
def ruleset : Game::Ruleset #

[View source]
def ruleset=(ruleset : Game::Ruleset) #

[View source]
def runs(page_size : Int32 = 200) : Srcom::Api::PageIterator(Run) #

Gets all Runs completed in this Game.

Defaults to getting all of them since there shouldn't be an absurd amount of `RunĀ“s in a single Game.


[View source]
def series : Array(Series) #

Gets all the Series this Game belongs to, if it belongs to any.

NOTE It is both possible for a game to not be part of a Series, and for it to be part of several.


[View source]
def variables : Array(Variable) #

[View source]
def variables=(variables : Array(Variable)) #

[View source]
def weblink : String #

[View source]
def weblink=(weblink : String) #

[View source]