Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Level

Details about a level, including its full representation

Hierarchy

Index

Properties

award

award: Award

The award the level has recieved

coins

coins: Coins

The level's coins

copy

copy: { copyable: boolean; password?: string }

The level's copying details

Type declaration

  • copyable: boolean

    Whether the level can be copied

  • Optional password?: string

    The level's password. Will only be present if the level is copyable and has a password set (i.e. won't be present if either not copyable or free copy)

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.

data

data: string

The raw level string before decoding and decompressing. Only offered because gd.js is not primarily a level API, so this can be passed to your own manipulation program.

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

updatedAt

updatedAt: GDDate

The level's update date

uploadedAt

uploadedAt: GDDate

The level's upload date

version

version: number

The level's version

Methods

decodeData

  • Decodes the level data

    Parameters

    • Optional full: false

      Whether to also parse the string level data

    Returns Promise<LevelData>

    The level data, with a parsed attribute if a full decode was requested

  • Decodes the level data

    Parameters

    • full: true

      Whether to also parse the string level data

    Returns Promise<FullLevelData>

    The level data, with a parsed attribute if a full decode was requested

getComments

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