Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Analysis

The analysis module provides a variety of functions for calculating information about runs.

Hierarchy

Index

Constructors

constructor

  • This constructor is an implementation detail. Do not use this.

    Parameters

    • ptr: number

    Returns Analysis

Properties

ptr

ptr: number

Methods

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

with

  • with<T>(closure: (obj: Analysis) => 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

    Returns T

Static calculateSumOfBest

  • calculateSumOfBest(run: RunRef, simpleCalculation: boolean, useCurrentRun: boolean, method: number): TimeSpan
  • Calculates the Sum of Best Segments for the timing method provided. This is the fastest time possible to complete a run of a category, based on information collected from all the previous attempts. This often matches up with the sum of the best segment times of all the segments, but that may not always be the case, as skipped segments may introduce combined segments that may be faster than the actual sum of their best segment times. The name is therefore a bit misleading, but sticks around for historical reasons. You can choose to do a simple calculation instead, which excludes the Segment History from the calculation process. If there's an active attempt, you can choose to take it into account as well. Can return null.

    Parameters

    • run: RunRef
    • simpleCalculation: boolean
    • useCurrentRun: boolean
    • method: number

    Returns TimeSpan

Static calculateTotalPlaytimeForRun

  • Calculates the total playtime of the passed Run.

    Parameters

    Returns TimeSpan

Static calculateTotalPlaytimeForTimer

  • Calculates the total playtime of the passed Timer.

    Parameters

    Returns TimeSpan

Generated using TypeDoc