Class Session

A wrapper around tracking items and meat gained from this session Smartly handles foldables being added/removed based on their state Provides operations to add sessions and subtract Sessions so you can isolate the value of each Session using a baseline

meat the raw meat associated with this Session

items a map representing the items gained/lost during this Session

Properties

items: Map<Item, number>
meat: number
totalTurns: number

Methods

  • Generate a new session combining multiple sessions together

    Parameters

    • other: Session

      the session from which to add elements to this set

    Returns Session

    a new session representing the addition of other to this

  • Parameters

    • other: Session

      the session to diff against this session when computing MPA

    • options: {
          excludeValue?: {
              item?: number;
              meat?: number;
          };
          isOutlier?: ((item: ItemDetail) => boolean);
          value: ((item: Item) => number);
      }

      options for computing MPA

      • OptionalexcludeValue?: {
            item?: number;
            meat?: number;
        }

        meat values to exclude when calculating specific portions of the MPA

        • Optionalitem?: number
        • Optionalmeat?: number
      • OptionalisOutlier?: ((item: ItemDetail) => boolean)

        a function to compute if an item is considered an outlier. By default, no items are outliers

          • (item): boolean
          • Parameters

            • item: ItemDetail

            Returns boolean

      • value: ((item: Item) => number)

        a function to compute the meat value of a given item

          • (item): number
          • Parameters

            • item: Item

            Returns number

    Returns MeatPerAdventureAnalysis

    an analysis of the effective MPA for the given session

  • Subtract the contents of another session from this one, removing any items that have a resulting quantity of 0 (this will ignore elements in b but not in a)

    Parameters

    • other: Session

      the session from which to pull values to remove from this session

    Returns Session

    a new session representing the difference between this session and the other session

  • Register session results that do not get tracked natively

    Parameters

    • target: Item | "meat"

      either the Item or a string saying "meat" of what quantity to modify

    • quantity: number

      How much to modify the tracked amount by

    Returns void

  • Export this session to a file in the data/ directory. Conventionally this file should end in ".json"

    Parameters

    • filename: string

      The file into which to export

    Returns void

  • Value this session

    Parameters

    • itemValue: ((item: Item) => number)

      a function that, when given an item, will give a meat value of the item

        • (item): number
        • Parameters

          • item: Item

          Returns number

    Returns ItemResult

    ItemResult with the full value of this session given the input function

  • Combine the contents of sessions

    Parameters

    • Rest...sessions: Session[]

      the set of sessions to combine together

    Returns Session

    a new session representing the difference between a and b

  • Parameters

    • baseline: Session

      the base session to use when computing MPA

    • full: Session

      the full session to use when computing MPA

    • options: {
          excludeValue?: {
              item?: number;
              meat?: number;
          };
          isOutlier?: ((item: ItemDetail) => boolean);
          value: ((item: Item) => number);
      }

      options for computing MPA

      • OptionalexcludeValue?: {
            item?: number;
            meat?: number;
        }

        meat values to exclude when calculating specific portions of the MPA

        • Optionalitem?: number
        • Optionalmeat?: number
      • OptionalisOutlier?: ((item: ItemDetail) => boolean)

        a function to compute if an item is considered an outlier. By default, no items are outliers

          • (item): boolean
          • Parameters

            • item: ItemDetail

            Returns boolean

      • value: ((item: Item) => number)

        a function to compute the meat value of a given item

          • (item): number
          • Parameters

            • item: Item

            Returns number

    Returns MeatPerAdventureAnalysis

    an analysis of the effective MPA for the given session

  • Return the meat and items for the current session

    Parameters

    • sessionOnly: boolean = false

      should closet, DC, and storage be ignored for the session calculation

    Returns Session

    current session

  • Subtract the contents of snasphot b from session a, removing any items that have a resulting quantity of 0 (this will ignore elements in b but not in a)

    Parameters

    • a: Session

      the session from which to subtract elements

    • b: Session

      the session from which to add elements

    Returns Session

    a new session representing the difference between a and b

  • Import a session from a file in the data/ directory. Conventionally the file should end in ".json"

    Parameters

    • filename: string

      The file from which to import

    Returns Session

    the session represented by the file

  • Parameters

    • filename: string

    Returns string