Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Run

A Run stores the split times for a specific game and category of a runner.

Hierarchy

Index

Constructors

constructor

  • new Run(ptr: number): Run
  • This constructor is an implementation detail. Do not use this.

    Parameters

    • ptr: number

    Returns Run

Properties

ptr

ptr: number

Methods

attemptCount

  • attemptCount(): number
  • Returns the amount of runs that have been attempted with these splits.

    Returns number

attemptHistoryIndex

  • Accesses the an attempt history element by its index. This does not store the actual segment times, just the overall attempt information. Information about the individual segments is stored within each segment. You may not provide an out of bounds index.

    Parameters

    • index: number

    Returns AttemptRef

attemptHistoryLen

  • attemptHistoryLen(): number
  • Returns the amount attempt history elements are stored in this Run.

    Returns number

autoSplitterSettings

  • autoSplitterSettings(): string
  • Accesses the Auto Splitter Settings that are encoded as XML.

    Returns string

categoryName

  • categoryName(): string
  • Accesses the name of the category this Run is for.

    Returns string

clone

  • Clones the Run object.

    Returns Run

customComparison

  • customComparison(index: number): string
  • Accesses a custom comparison stored in this Run by its index. This includes Personal Best but excludes all the other Comparison Generators. You may not provide an out of bounds index.

    Parameters

    • index: number

    Returns string

customComparisonsLen

  • customComparisonsLen(): number
  • Returns the amount of custom comparisons stored in this Run.

    Returns number

dispose

  • dispose(): void
  • Disposes the object, allowing it to clean up all of its memory. You need to call this for every object that you don't use anymore and hasn't already been disposed.

    Returns void

extendedCategoryName

  • extendedCategoryName(showRegion: boolean, showPlatform: boolean, showVariables: boolean): string
  • Returns an extended category name that possibly includes the region, platform and variables, depending on the arguments provided. An extended category name may look like this:

    Any% (No Tuner, JPN, Wii Emulator)

    Parameters

    • showRegion: boolean
    • showPlatform: boolean
    • showVariables: boolean

    Returns string

extendedFileName

  • extendedFileName(useExtendedCategoryName: boolean): string
  • Returns a file name (without the extension) suitable for this Run that is built the following way:

    Game Name - Category Name

    If either is empty, the dash is omitted. Special characters that cause problems in file names are also omitted. If an extended category name is used, the variables of the category are appended in a parenthesis.

    Parameters

    • useExtendedCategoryName: boolean

    Returns string

extendedName

  • extendedName(useExtendedCategoryName: boolean): string
  • Returns a name suitable for this Run that is built the following way:

    Game Name - Category Name

    If either is empty, the dash is omitted. If an extended category name is used, the variables of the category are appended in a parenthesis.

    Parameters

    • useExtendedCategoryName: boolean

    Returns string

gameIconLen

  • gameIconLen(): number
  • Accesses the amount of bytes the game icon's data takes up.

    Returns number

gameIconPtr

  • gameIconPtr(): number
  • Accesses the game icon's data. If there is no game icon, this returns an empty buffer.

    Returns number

gameName

  • gameName(): string
  • Accesses the name of the game this Run is for.

    Returns string

hasBeenModified

  • hasBeenModified(): boolean
  • Returns whether the Run has been modified and should be saved so that the changes don't get lost.

    Returns boolean

len

  • len(): number
  • Returns the amount of segments stored in this Run.

    Returns number

markAsModified

  • markAsModified(): void
  • Marks the Run as modified, so that it is known that there are changes that should be saved.

    Returns void

metadata

  • Accesses additional metadata of this Run, like the platform and region of the game.

    Returns RunMetadataRef

offset

  • Accesses the time an attempt of this Run should start at.

    Returns TimeSpanRef

pushSegment

  • pushSegment(segment: Segment): void
  • Pushes the segment provided to the end of the list of segments of this Run.

    Parameters

    Returns void

saveAsLss

  • saveAsLss(): string
  • Saves a Run as a LiveSplit splits file (*.lss). If the run is actively in use by a timer, use the appropriate method on the timer instead, in order to properly save the current attempt as well.

    Returns string

segment

  • Accesses a certain segment of this Run. You may not provide an out of bounds index.

    Parameters

    • index: number

    Returns SegmentRef

setCategoryName

  • setCategoryName(category: string): void
  • Sets the name of the category this Run is for.

    Parameters

    • category: string

    Returns void

setGameName

  • setGameName(game: string): void
  • Sets the name of the game this Run is for.

    Parameters

    • game: string

    Returns void

with

  • with<T>(closure: (obj: Run) => T): T
  • Allows for scoped usage of the object. The object is guaranteed to get disposed once this function returns. You are free to dispose the object early yourself anywhere within the scope. The scope's return value gets carried to the outside of this function.

    Type parameters

    • T

    Parameters

    • closure: (obj: Run) => T
        • Parameters

          Returns T

    Returns T

Static new

  • Creates a new Run object with no segments.

    Returns Run

Static parse

  • parse(data: number, length: number, path: string, loadFiles: boolean): ParseRunResult
  • Attempts to parse a splits file from an array by invoking the corresponding parser for the file format detected. A path to the splits file can be provided, which helps saving the splits file again later. Additionally you need to specify if additional files, like external images are allowed to be loaded. If you are using livesplit-core in a server-like environment, set this to false. Only client-side applications should set this to true.

    Parameters

    • data: number
    • length: number
    • path: string
    • loadFiles: boolean

    Returns ParseRunResult

Static parseArray

  • parseArray(data: Int8Array, path: string, loadFiles: boolean): ParseRunResult
  • Parameters

    • data: Int8Array
    • path: string
    • loadFiles: boolean

    Returns ParseRunResult

Static parseFileHandle

  • parseFileHandle(handle: number, path: string, loadFiles: boolean): ParseRunResult
  • Attempts to parse a splits file from a file by invoking the corresponding parser for the file format detected. A path to the splits file can be provided, which helps saving the splits file again later. Additionally you need to specify if additional files, like external images are allowed to be loaded. If you are using livesplit-core in a server-like environment, set this to false. Only client-side applications should set this to true. On Unix you pass a file descriptor to this function. On Windows you pass a file handle to this function. The file descriptor / handle does not get closed.

    Parameters

    • handle: number
    • path: string
    • loadFiles: boolean

    Returns ParseRunResult

Static parseString

  • parseString(text: string, path: string, loadFiles: boolean): ParseRunResult
  • Parameters

    • text: string
    • path: string
    • loadFiles: boolean

    Returns ParseRunResult

Generated using TypeDoc