Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SearchedLevel

Details about a level returned from a search

Hierarchy

Index

Properties

award

award: Award

The award the level has recieved

coins

coins: Coins

The level's coins

creator

creator: { accountID?: number; id: number }

The level's creator

Type declaration

  • Optional accountID?: number

    The creator's account ID (if the user is registered)

  • id: number

    The creator's user ID.

description

description: string

The level's description

diamonds

diamonds: number

The number of diamonds the level gives

difficulty

difficulty: { level: DifficultyLevel; requestedStars: number; stars: number }

The level's difficulty rating

Type declaration

  • level: DifficultyLevel

    The difficulty level

  • requestedStars: number

    The number of stars the creator requested

  • stars: number

    The number of stars the level received. Will be 0 if it has no rating

gameVersion

gameVersion: number

The game version in which the level was built

id

id: number

The level's ID. If you are creating a new level, this is 0

name

name: string

The name of the level

orbs

orbs: number

The number of orbs the level gives

Optional original

original: number

The ID of the original level the level was copied from. Only exists if the level was copied

song

song: Song

The song the level uses

stats

stats: { downloads: number; length: LevelLength; likes: number; objects: number }

The level's statistics

Type declaration

  • downloads: number

    The number of downloads the level has received

  • length: LevelLength

    The length of the level

  • likes: number

    The number of likes the level has received

  • objects: number

    The number of objects in the level

version

version: number

The level's version

Methods

getComments

  • Gets the top comment on this level

    async

    Parameters

    • Optional byLikes: boolean

      Whether to sort by likes or not

    Returns Promise<LevelComment<StatlessSearchedUser>>

    The most recent or most liked comment made on this level

  • Gets the comments on this level

    async

    Parameters

    • byLikes: boolean

      Whether to sort by likes or not

    • num: number

      The number of comments to get

    Returns Promise<LevelComment<StatlessSearchedUser>[]>

    The most recent or most liked comments made on this level

getCreator

  • getCreator(): Promise<User>
  • Gets the level's creator. Will only succeed if the creator is registered

    async

    Returns Promise<User>

    The creator if it was registered, otherwise null

resolve

  • resolve(): Promise<Level>
  • Get the full level from its searched counterpart.

    async

    Returns Promise<Level>

    The full level

Generated using TypeDoc