class Srcom::Api::Levels

Defined in:

srcr/apis/levels.cr

Constant Summary

Log = Srcom::Log.for("levels")

Class Method Summary

Class Method Detail

def self.find_by_id(id : String) : Srcom::Level #

Gets a Level given its id.


[View source]
def self.get_categories(id : String, miscellaneous : Bool | Nil = nil, order_by : String | Nil = nil, sort_direction : String | Nil = nil) : Array(Category) #

Gets the categories applicable to the Level given by its id.

Possible values for order_by: "name", "miscellaneous", or "pos", with the default being "pos".

Possible values for sort_direction: "desc" or "asc", with the default being "asc".

NOTE If miscellaneous is set to true only miscellaneous categories will be returned. If it is set to false only non-miscellaneous categories will be returned. If it is set to nil both miscellaneous and non-miscellaneous categories will be returned.


[View source]
def self.get_records(id : String, top : Int32 = 3, skip_empty : Bool = false, page_size : Int32 = 200) : PageIterator(Leaderboard) #

Gets the Leaderboards with the top N runs for the Level with the given id, skipping over empty Leaderboards if skip_empty is true.

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

NOTE This returns one Leaderboard for each Category that the Level can be played in.


[View source]
def self.get_variables(id : String, order_by : String | Nil = nil, sort_direction : String | Nil = nil) : Array(Variable) #

Gets the Variables applicable to the Level given by its id.

Possible values for order_by: "name", "mandatory", "pos" or "user-defined", with the default being "pos".

Possible values for sort_direction: "desc" or "asc", with the default being "asc".


[View source]